Examples of IConstantPoolEntry


Examples of org.eclipse.jdt.core.util.IConstantPoolEntry

    if ((flags & IModifierConstants.ACC_SYNTHETIC) != 0) {
      this.isSynthetic = true;
    }

    this.nameIndex = u2At(classFileBytes, 2, offset);
    IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.nameIndex);
    if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    this.name = constantPoolEntry.getUtf8Value();

    this.descriptorIndex = u2At(classFileBytes, 4, offset);
    constantPoolEntry = constantPool.decodeEntry(this.descriptorIndex);
    if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    this.descriptor = constantPoolEntry.getUtf8Value();

    this.attributesCount = u2At(classFileBytes, 6, offset);
    this.attributes = ClassFileAttribute.NO_ATTRIBUTES;
    if (this.attributesCount != 0) {
      if (no_code_attribute && !isAbstract() && !isNative()) {
        if (this.attributesCount != 1) {
          this.attributes = new IClassFileAttribute[this.attributesCount - 1];
        }
      } else {
        this.attributes = new IClassFileAttribute[this.attributesCount];
      }
    }
    int attributesIndex = 0;
    int readOffset = 8;
    for (int i = 0; i < this.attributesCount; i++) {
      constantPoolEntry = constantPool.decodeEntry(u2At(classFileBytes, readOffset, offset));
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      char[] attributeName = constantPoolEntry.getUtf8Value();
      if (equals(attributeName, IAttributeNamesConstants.DEPRECATED)) {
        this.isDeprecated = true;
        this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
      } else if (equals(attributeName, IAttributeNamesConstants.SYNTHETIC)) {
        this.isSynthetic = true;
View Full Code Here

Examples of org.eclipse.jdt.core.util.IConstantPoolEntry

  private char[] attributeName;

  public ClassFileAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException {
    this.attributeNameIndex = u2At(classFileBytes, 0, offset);
    this.attributeLength = u4At(classFileBytes, 2, offset);
    IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.attributeNameIndex);
    if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    this.attributeName = constantPoolEntry.getUtf8Value();
  }
View Full Code Here

Examples of org.eclipse.jdt.core.util.IConstantPoolEntry

      this.startPC = u2At(classFileBytes, 0, offset);
      this.length = u2At(classFileBytes, 2, offset);
      this.nameIndex = u2At(classFileBytes, 4, offset);
      this.descriptorIndex = u2At(classFileBytes, 6, offset);
      this.index = u2At(classFileBytes, 8, offset);
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.nameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.name = constantPoolEntry.getUtf8Value();
      constantPoolEntry = constantPool.decodeEntry(this.descriptorIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.descriptor = constantPoolEntry.getUtf8Value();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.