Package org.eclipse.jdt.core.util

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


      this.nameIndex = u2At(classFileBytes, 4, offset);
      this.signatureIndex = 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.signatureIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.signature = constantPoolEntry.getUtf8Value();
    }
View Full Code Here


        final int constantIndex = u2At(classFileBytes, 1, offset);
        this.constantPoolIndex = constantIndex;
        if (constantIndex != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(constantIndex);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.classTypeName = constantPoolEntry.getClassInfoName();
        }
        this.readOffset += 2;
        break;
View Full Code Here

            case IConstantPoolConstant.CONSTANT_Double :
            case IConstantPoolConstant.CONSTANT_Integer :
            case IConstantPoolConstant.CONSTANT_Utf8 :
              break;
            default :
              throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.constantValue = constantPoolEntry;
        }
        this.readOffset += 2;
        break;
      case 'e' :
        int index = u2At(classFileBytes, this.readOffset, offset);
        this.enumConstantTypeNameIndex = index;
        if (index != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.enumConstantTypeName = constantPoolEntry.getUtf8Value();
        }
        this.readOffset += 2;
        index = u2At(classFileBytes, this.readOffset, offset);
        this.enumConstantNameIndex = index;
        if (index != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.enumConstantName = constantPoolEntry.getUtf8Value();
        }
        this.readOffset += 2;
        break;
      case 'c' :
        final int classFileIndex = u2At(classFileBytes, this.readOffset, offset);
        this.classFileInfoIndex = classFileIndex;
        if (classFileIndex != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(classFileIndex);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.classInfo = constantPoolEntry;
        }
        this.readOffset += 2;
        break;
View Full Code Here

    IConstantPoolEntry constantPoolEntry;
    for (int i = 0; i < exceptionLength; i++) {
      this.exceptionIndexes[i] = u2At(classFileBytes, readOffset, offset);
      constantPoolEntry = constantPool.decodeEntry(this.exceptionIndexes[i]);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.exceptionNames[i] = constantPoolEntry.getClassInfoName();
      readOffset += 2;
    }
  }
View Full Code Here

    this.typeIndex = index;
    this.readOffset+=2;
    if (index != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.typeName = constantPoolEntry.getUtf8Value();
    } else {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    final int length = u2At(classFileBytes, this.readOffset, offset);
    this.componentsNumber = length;
    this.readOffset+=2;
    if (length != 0) {
View Full Code Here

    final int index = u2At(classFileBytes, 0, offset);
    this.typeIndex = index;
    if (index != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.typeName = constantPoolEntry.getUtf8Value();
    } else {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    final int length = u2At(classFileBytes, 2, offset);
    this.componentsNumber = length;
    this.readOffset = 4;
    if (length != 0) {
View Full Code Here

    final int nameIndex = u2At(classFileBytes, 0, offset);
    this.componentNameIndex = nameIndex;
    if (nameIndex != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(nameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.componentName = constantPoolEntry.getUtf8Value();
    }
    this.readOffset = 2;
    AnnotationComponentValue value = new AnnotationComponentValue(classFileBytes, constantPool, offset + this.readOffset);
View Full Code Here

    super(classFileBytes, constantPool, offset);
    final int index = u2At(classFileBytes, 6, offset);
    this.signatureIndex = index;
    IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
    if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    this.signature = constantPoolEntry.getUtf8Value();
  }
View Full Code Here

    this.handlerPC = u2At(classFileBytes, 4, offset);
    this.catchTypeIndex = u2At(classFileBytes, 6, offset);
    if (this.catchTypeIndex != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.catchTypeIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.catchType = constantPoolEntry.getClassInfoName();
    }
  }
View Full Code Here

    this.accessFlags = u2At(classFileBytes, 6, offset);
    IConstantPoolEntry constantPoolEntry;
    if (this.innerClassNameIndex != 0) {
      constantPoolEntry = constantPool.decodeEntry(this.innerClassNameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.innerClassName = constantPoolEntry.getClassInfoName();
    }
    if (this.outerClassNameIndex != 0) {
      constantPoolEntry = constantPool.decodeEntry(this.outerClassNameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.outerClassName = constantPoolEntry.getClassInfoName();
    }
    if (this.innerNameIndex != 0) {
      constantPoolEntry = constantPool.decodeEntry(this.innerNameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.innerName = constantPoolEntry.getUtf8Value();
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.util.ClassFormatException

Copyright © 2018 www.massapicom. 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.