Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.MethodBinding


        // we cannot create problem methods for an interface. So we have to generate a clinit
        // which should contain all the problem
        classFile.addProblemClinit(problemsCopy);
        for (int i = 0, length = methodDecls.length; i < length; i++) {
          AbstractMethodDeclaration methodDecl = methodDecls[i];
          MethodBinding method = methodDecl.binding;
          if (method == null || method.isConstructor()) continue;
          method.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract;
          classFile.addAbstractMethod(methodDecl, method);
        }
      } else {
        for (int i = 0, length = methodDecls.length; i < length; i++) {
          AbstractMethodDeclaration methodDecl = methodDecls[i];
          MethodBinding method = methodDecl.binding;
          if (method == null) continue;
          if (method.isConstructor()) {
            classFile.addProblemConstructor(methodDecl, method, problemsCopy);
          } else if (method.isAbstract()) {
            classFile.addAbstractMethod(methodDecl, method);
          } else {
            classFile.addProblemMethod(methodDecl, method, problemsCopy);
          }
        }
View Full Code Here


   */
  public void addDefaultAbstractMethods() { // default abstract methods
    MethodBinding[] defaultAbstractMethods =
      this.referenceBinding.getDefaultAbstractMethods();
    for (int i = 0, max = defaultAbstractMethods.length; i < max; i++) {
      MethodBinding methodBinding = defaultAbstractMethods[i];
      generateMethodInfoHeader(methodBinding);
      int methodAttributeOffset = this.contentsOffset;
      int attributeNumber = generateMethodInfoAttributes(methodBinding);
      completeMethodInfo(methodBinding, methodAttributeOffset, attributeNumber);
    }
View Full Code Here

    // default abstract methods
    generateMissingAbstractMethods(this.referenceBinding.scope.referenceType().missingAbstractMethods, this.referenceBinding.scope.referenceCompilationUnit().compilationResult);

    MethodBinding[] defaultAbstractMethods = this.referenceBinding.getDefaultAbstractMethods();
    for (int i = 0, max = defaultAbstractMethods.length; i < max; i++) {
      MethodBinding methodBinding = defaultAbstractMethods[i];
      generateMethodInfoHeader(methodBinding);
      int methodAttributeOffset = this.contentsOffset;
      int attributeNumber = generateMethodInfoAttributes(methodBinding);
      completeMethodInfo(methodBinding, methodAttributeOffset, attributeNumber);
    }
View Full Code Here

            resizeContents(2);
          }
          final int elementNameIndex = this.constantPool.literalIndex(memberValuePair.name);
          this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
          this.contents[this.contentsOffset++] = (byte) elementNameIndex;
          MethodBinding methodBinding = memberValuePair.binding;
          if (methodBinding == null) {
            this.contentsOffset = startingContentsOffset;
          } else {
            try {
              generateElementValue(memberValuePair.value, methodBinding.returnType, startingContentsOffset);
            } catch(ClassCastException e) {
              this.contentsOffset = startingContentsOffset;
            } catch(ShouldNotImplement e) {
              this.contentsOffset = startingContentsOffset;
            }
          }
        }
      } else {
        this.contents[this.contentsOffset++] = 0;
        this.contents[this.contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      this.contents[this.contentsOffset++] = 0;
      this.contents[this.contentsOffset++] = 1;
      if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = this.constantPool.literalIndex(VALUE);
      this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        this.contentsOffset = startingContentsOffset;
      } else {
        try {
          generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, startingContentsOffset);
View Full Code Here

    this.contents[localContentsOffset++] = (byte) (enclosingTypeIndex >> 8);
    this.contents[localContentsOffset++] = (byte) enclosingTypeIndex;
    byte methodIndexByte1 = 0;
    byte methodIndexByte2 = 0;
    if (this.referenceBinding instanceof LocalTypeBinding) {
      MethodBinding methodBinding = ((LocalTypeBinding) this.referenceBinding).enclosingMethod;
      if (methodBinding != null) {
        int enclosingMethodIndex = this.constantPool.literalIndexForNameAndType(methodBinding.selector, methodBinding.signature(this));
        methodIndexByte1 = (byte) (enclosingMethodIndex >> 8);
        methodIndexByte2 = (byte) enclosingMethodIndex;
      }
    }
    this.contents[localContentsOffset++] = methodIndexByte1;
View Full Code Here

      TypeDeclaration currentDeclaration = this.referenceBinding.scope.referenceContext;
      int typeDeclarationSourceStart = currentDeclaration.sourceStart();
      int typeDeclarationSourceEnd = currentDeclaration.sourceEnd();
      for (int i = 0, max = methodDeclarations.length; i < max; i++) {
        MethodDeclaration methodDeclaration = methodDeclarations[i];
        MethodBinding methodBinding = methodDeclaration.binding;
         String readableName = new String(methodBinding.readableName());
         CategorizedProblem[] problems = compilationResult.problems;
         int problemsCount = compilationResult.problemCount;
        for (int j = 0; j < problemsCount; j++) {
          CategorizedProblem problem = problems[j];
          if (problem != null
View Full Code Here

    new String[] {new String(type.shortReadableName())},
    location.sourceStart,
    location.sourceEnd);
}
public void bytecodeExceeds64KLimit(AbstractMethodDeclaration location) {
  MethodBinding method = location.binding;
  if (location.isConstructor()) {
    this.handle(
      IProblem.BytecodeExceeds64KLimitForConstructor,
      new String[] {new String(location.selector), typesAsString(method, false)},
      new String[] {new String(location.selector), typesAsString(method, true)},
View Full Code Here

    NoArgument,
    statement.sourceStart,
    statement.sourceEnd);
}
public void duplicateEnumSpecialMethod(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) {
    MethodBinding method = methodDecl.binding;
  this.handle(
    IProblem.CannotDeclareEnumSpecialMethod,
    new String[] {
          new String(methodDecl.selector),
      new String(method.declaringClass.readableName()),
View Full Code Here

    arguments,
    nodeSourceStart(local, location),
    nodeSourceEnd(local, location));
}
public void duplicateMethodInType(SourceTypeBinding type, AbstractMethodDeclaration methodDecl, boolean equalParameters) {
    MethodBinding method = methodDecl.binding;
    if (equalParameters) {
    this.handle(
      IProblem.DuplicateMethod,
      new String[] {
            new String(methodDecl.selector),
View Full Code Here

    NoArgument,
    sourceStart,
    sourceEnd);
}
public void enumAbstractMethodMustBeImplemented(AbstractMethodDeclaration method) {
  MethodBinding abstractMethod = method.binding;
  this.handle(
    // Must implement the inherited abstract method %1
    // 8.4.3 - Every non-abstract subclass of an abstract type, A, must provide a concrete implementation of all of A's methods.
    IProblem.EnumAbstractMethodMustBeImplemented,
    new String[] {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.MethodBinding

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.