1 11 package org.eclipse.jdt.internal.core.util; 12 13 import org.eclipse.jdt.core.util.ClassFormatException; 14 import org.eclipse.jdt.core.util.IConstantPool; 15 import org.eclipse.jdt.core.util.IConstantPoolConstant; 16 import org.eclipse.jdt.core.util.IConstantPoolEntry; 17 import org.eclipse.jdt.core.util.IExceptionTableEntry; 18 19 23 public class ExceptionTableEntry 24 extends ClassFileStruct 25 implements IExceptionTableEntry { 26 27 private int startPC; 28 private int endPC; 29 private int handlerPC; 30 private int catchTypeIndex; 31 private char[] catchType; 32 33 ExceptionTableEntry(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException { 34 this.startPC = u2At(classFileBytes, 0, offset); 35 this.endPC = u2At(classFileBytes, 2, offset); 36 this.handlerPC = u2At(classFileBytes, 4, offset); 37 this.catchTypeIndex = u2At(classFileBytes, 6, offset); 38 if (this.catchTypeIndex != 0) { 39 IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.catchTypeIndex); 40 if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) { 41 throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); 42 } 43 this.catchType = constantPoolEntry.getClassInfoName(); 44 } 45 } 46 49 public int getStartPC() { 50 return this.startPC; 51 } 52 53 56 public int getEndPC() { 57 return this.endPC; 58 } 59 60 63 public int getHandlerPC() { 64 return this.handlerPC; 65 } 66 67 70 public int getCatchTypeIndex() { 71 return this.catchTypeIndex; 72 } 73 74 77 public char[] getCatchType() { 78 return this.catchType; 79 } 80 81 } 82 | Popular Tags |