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

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


  If no visible method is discovered, an error binding is answered.
*/

public MethodBinding getImplicitMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {
  // retrieve an exact visible match (if possible)
  MethodBinding methodBinding = findExactMethod(receiverType, selector, argumentTypes, invocationSite);
  if (methodBinding == null)
    methodBinding = findMethod(receiverType, selector, argumentTypes, invocationSite);
  if (methodBinding != null) { // skip it if we did not find anything
    if (methodBinding.isValidBinding())
        if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
        return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotVisible);
    return methodBinding;
  }
  return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
View Full Code Here


        // 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;
          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 {
            classFile.addProblemMethod(methodDecl, method, problemsCopy);
          }
        }
View Full Code Here

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

            resizeContents(2);
          }
          final int elementNameIndex = constantPool.literalIndex(memberValuePair.name);
          contents[contentsOffset++] = (byte) (elementNameIndex >> 8);
          contents[contentsOffset++] = (byte) elementNameIndex;
          MethodBinding methodBinding = memberValuePair.binding;
          if (methodBinding == null) {
            contentsOffset = attributeOffset;
          } else {
            generateElementValue(memberValuePair.value, methodBinding.returnType, attributeOffset);
          }
        }
      } else {
        contents[contentsOffset++] = 0;
        contents[contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      contents[contentsOffset++] = 0;
      contents[contentsOffset++] = 1;
      if (contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = constantPool.literalIndex(VALUE);
      contents[contentsOffset++] = (byte) (elementNameIndex >> 8);
      contents[contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        contentsOffset = attributeOffset;
      } else {
        generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, attributeOffset);
      }
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

    if (defaultValue == null) return false;
    return defaultValue.equals(value2);
  }

  public boolean isDeprecated() {
    MethodBinding methodBinding = this.internalPair.getMethodBinding();
    return methodBinding == null ? false : methodBinding.isDeprecated();
  }
View Full Code Here

      MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
      if (memberValuePairs != null) {
        int memberValuePairsLength = memberValuePairs.length;
        for (int i = 0; i < memberValuePairsLength; i++) {
          MemberValuePair memberValuePair = memberValuePairs[i];
          MethodBinding methodBinding = memberValuePair.binding;
          if (methodBinding == null) {
            // is this just a marker annotation?
            throw new MissingImplementationException(
                "Please raise an AspectJ bug.  AspectJ does not know how to convert this annotation [" + annotation
                    + "]");
          } else {
            AnnotationValue av = generateElementValue(memberValuePair.value, methodBinding.returnType);
            AnnotationNameValuePair anvp = new AnnotationNameValuePair(new String(memberValuePair.name), av);
            annotationAJ.addNameValuePair(anvp);
          }
        }
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      // this is a single member annotation (one member value)
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        throw new MissingImplementationException(
            "Please raise an AspectJ bug.  AspectJ does not know how to convert this annotation [" + annotation + "]");
      } else {
        AnnotationValue av = generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType);
View Full Code Here

      return;

    if (send.isSuperAccess() && !send.binding.isStatic()) {
      send.receiver = new ThisReference(send.sourceStart, send.sourceEnd);
      // send.arguments = AstUtil.insert(new ThisReference(send.sourceStart, send.sourceEnd), send.arguments);
      MethodBinding superAccessBinding = getSuperAccessMethod(send.binding);
      AstUtil.replaceMethodBinding(send, superAccessBinding);
    } else if (!isPublic(send.binding)) {
      send.syntheticAccessor = getAccessibleMethod(send.binding, send.actualReceiverType);
    }
View Full Code Here

      // runtime this will be satisfied by the super).
      m = world.makeResolvedMember(binding, receiverType);
    }
    if (inAspect.accessForInline.containsKey(m))
      return (MethodBinding) inAspect.accessForInline.get(m);
    MethodBinding ret = world.makeMethodBinding(AjcMemberMaker.inlineAccessMethodForMethod(inAspect.typeX, m));
    inAspect.accessForInline.put(m, ret);
    return ret;
  }
View Full Code Here

    ResolvedMember m = world.makeResolvedMember(binding);
    ResolvedMember superAccessMember = AjcMemberMaker.superAccessMethod(inAspect.typeX, m);
    if (inAspect.superAccessForInline.containsKey(superAccessMember)) {
      return ((SuperAccessMethodPair) inAspect.superAccessForInline.get(superAccessMember)).accessMethod;
    }
    MethodBinding ret = world.makeMethodBinding(superAccessMember);
    inAspect.superAccessForInline.put(superAccessMember, new SuperAccessMethodPair(m, ret));
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.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.