/** * @see IConstantPool#getEntryKind(int) */ public int getEntryKind(int index) { return u1At(this.classFileBytes, 0, this.constantPoolOffset[index]); }
ConstantPoolEntry constantPoolEntry = new ConstantPoolEntry(); constantPoolEntry.reset(); int kind = getEntryKind(index); constantPoolEntry.setKind(kind); switch(kind) { case IConstantPoolConstant.CONSTANT_Class : constantPoolEntry.setClassInfoNameIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); constantPoolEntry.setClassInfoName(getUtf8ValueAt(constantPoolEntry.getClassInfoNameIndex())); break; case IConstantPoolConstant.CONSTANT_Double : constantPoolEntry.setDoubleValue(doubleAt(this.classFileBytes, 1, this.constantPoolOffset[index])); break; case IConstantPoolConstant.CONSTANT_Fieldref : constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); int declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); int fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); constantPoolEntry.setFieldName(getUtf8ValueAt(fieldNameIndex)); constantPoolEntry.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex)); break; case IConstantPoolConstant.CONSTANT_Methodref : case IConstantPoolConstant.CONSTANT_InterfaceMethodref : constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int methodNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]);
this.constantPool = new ConstantPool(classFileBytes, constantPoolOffsets);
int kind = getEntryKind(index); switch(kind) { case IConstantPoolConstant.CONSTANT_Class : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassInfoNameIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); constantPoolEntry.setClassInfoName(getUtf8ValueAt(constantPoolEntry.getClassInfoNameIndex())); break; case IConstantPoolConstant.CONSTANT_Double : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setDoubleValue(doubleAt(this.classFileBytes, 1, this.constantPoolOffset[index])); break; case IConstantPoolConstant.CONSTANT_Fieldref : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); int declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); int fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); constantPoolEntry.setFieldName(getUtf8ValueAt(fieldNameIndex)); constantPoolEntry.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex)); break; case IConstantPoolConstant.CONSTANT_Methodref :
this.constantPool = new ConstantPool(classFileBytes, constantPoolOffsets);
int kind = getEntryKind(index); switch(kind) { case IConstantPoolConstant.CONSTANT_Class : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassInfoNameIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); constantPoolEntry.setClassInfoName(getUtf8ValueAt(constantPoolEntry.getClassInfoNameIndex())); break; case IConstantPoolConstant.CONSTANT_Double : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setDoubleValue(doubleAt(this.classFileBytes, 1, this.constantPoolOffset[index])); break; case IConstantPoolConstant.CONSTANT_Fieldref : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); int declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); int fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); constantPoolEntry.setFieldName(getUtf8ValueAt(fieldNameIndex)); constantPoolEntry.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex)); break; case IConstantPoolConstant.CONSTANT_Methodref :
/** * @see IConstantPool#getEntryKind(int) */ public int getEntryKind(int index) { return u1At(this.classFileBytes, 0, this.constantPoolOffset[index]); }
this.constantPool = new ConstantPool(classFileBytes, constantPoolOffsets);
int kind = getEntryKind(index); switch(kind) { case IConstantPoolConstant.CONSTANT_Class : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassInfoNameIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); constantPoolEntry.setClassInfoName(getUtf8ValueAt(constantPoolEntry.getClassInfoNameIndex())); break; case IConstantPoolConstant.CONSTANT_Double : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setDoubleValue(doubleAt(this.classFileBytes, 1, this.constantPoolOffset[index])); break; case IConstantPoolConstant.CONSTANT_Fieldref : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); int declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); int fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); constantPoolEntry.setFieldName(getUtf8ValueAt(fieldNameIndex)); constantPoolEntry.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex)); break; case IConstantPoolConstant.CONSTANT_Methodref :
/** * @see IConstantPool#getEntryKind(int) */ public int getEntryKind(int index) { return u1At(this.classFileBytes, 0, this.constantPoolOffset[index]); }
this.constantPool = new ConstantPool(classFileBytes, constantPoolOffsets);
public IConstantPoolEntry decodeEntry(int index) { ConstantPoolEntry constantPoolEntry = null; int kind = getEntryKind(index); switch(kind) { case IConstantPoolConstant.CONSTANT_Class : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassInfoNameIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); constantPoolEntry.setClassInfoName(getUtf8ValueAt(constantPoolEntry.getClassInfoNameIndex())); break; case IConstantPoolConstant.CONSTANT_Double : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setDoubleValue(doubleAt(this.classFileBytes, 1, this.constantPoolOffset[index])); break; case IConstantPoolConstant.CONSTANT_Fieldref : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); int declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); int fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); constantPoolEntry.setFieldName(getUtf8ValueAt(fieldNameIndex)); constantPoolEntry.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex));
/** * @see IConstantPool#getEntryKind(int) */ @Override public int getEntryKind(int index) { return u1At(this.classFileBytes, 0, this.constantPoolOffset[index]); }
this.constantPool = new ConstantPool(classFileBytes, constantPoolOffsets);
int kind = getEntryKind(index); switch(kind) { case IConstantPoolConstant.CONSTANT_Class : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassInfoNameIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); constantPoolEntry.setClassInfoName(getUtf8ValueAt(constantPoolEntry.getClassInfoNameIndex())); break; case IConstantPoolConstant.CONSTANT_Double : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setDoubleValue(doubleAt(this.classFileBytes, 1, this.constantPoolOffset[index])); break; case IConstantPoolConstant.CONSTANT_Fieldref : constantPoolEntry.reset(); constantPoolEntry.setKind(kind); constantPoolEntry.setClassIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); int declaringClassIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getClassIndex()]); constantPoolEntry.setClassName(getUtf8ValueAt(declaringClassIndex)); constantPoolEntry.setNameAndTypeIndex(u2At(this.classFileBytes, 3, this.constantPoolOffset[index])); int fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); int fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[constantPoolEntry.getNameAndTypeIndex()]); constantPoolEntry.setFieldName(getUtf8ValueAt(fieldNameIndex)); constantPoolEntry.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex)); break; case IConstantPoolConstant.CONSTANT_Methodref :