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

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


    pre.scope.parent = newParent;

    pre.resolveStatements(); // newParent);

    int nParams = pre.arguments.length;
    MethodBinding explicitConstructor = null;
    if (explicitConstructorCall != null) {
      explicitConstructor = explicitConstructorCall.binding;
      // If it is null then we are going to report something else is wrong with this code!
      if (explicitConstructor != null && explicitConstructor.alwaysNeedsAccessMethod()) {
        explicitConstructor = explicitConstructor.getAccessMethod(true);
      }
    }

    int nExprs;
    if (explicitConstructor == null)
View Full Code Here


  }

  private AjAttribute makeAttribute(EclipseFactory world) {
    if (explicitConstructorCall != null && (explicitConstructorCall.binding != null)
        && !(explicitConstructorCall.binding instanceof ProblemMethodBinding)) {
      MethodBinding explicitConstructor = explicitConstructorCall.binding;
      if (explicitConstructor.alwaysNeedsAccessMethod()) {
        explicitConstructor = explicitConstructor.getAccessMethod(true);
      }
      if (explicitConstructor instanceof ParameterizedMethodBinding) {
        explicitConstructor = explicitConstructor.original();
      }
      ((NewConstructorTypeMunger) munger).setExplicitConstructor(world.makeResolvedMember(explicitConstructor));
    } else {
      ((NewConstructorTypeMunger) munger).setExplicitConstructor(new ResolvedMemberImpl(Member.CONSTRUCTOR, world
          .fromBinding(onTypeBinding.superclass()), 0, ResolvedType.VOID, "<init>", UnresolvedType.NONE));
View Full Code Here

  public int removeUnusedExtraArguments() {
    int extraArgumentFlags = 0;
   
    this.computeJoinPointParams();
    MethodBinding binding = method.binding;
   
   
    int index = binding.parameters.length - 3;
    if (needsStaticEnclosing) {
      extraArgumentFlags |= Advice.ThisEnclosingJoinPointStaticPart;
View Full Code Here

  }
  return true;
}
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {

  MethodBinding constructorBinding = null;
  boolean isSynthetic = false;
  if (reference instanceof ExplicitConstructorCall) {
    ExplicitConstructorCall call = (ExplicitConstructorCall) reference;
    isSynthetic = call.isImplicitSuper();
    constructorBinding = call.binding;
View Full Code Here

}
public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding constructor = (MethodBinding) binding;
  int level= matchConstructor(constructor);
  if (level== IMPOSSIBLE_MATCH) {
    if (constructor != constructor.original()) {
      level= matchConstructor(constructor.original());
    }
  }
  return level;
}
View Full Code Here

  }

  public void consumeMethod(char[] selector, char[] signature) {
    MethodBinding[] methods = ((ReferenceBinding) this.typeBinding).availableMethods(); // resilience
     for (int i = 0, methodLength = methods.length; i < methodLength; i++) {
      MethodBinding method = methods[i];
      if (CharOperation.equals(selector, method.selector) || (selector.length == 0 && method.isConstructor())) {
        char[] methodSignature = method.genericSignature();
        if (methodSignature == null)
          methodSignature = method.signature();
        if (CharOperation.equals(signature, methodSignature)) {
          this.typeBinding = null;
          this.methodBinding = method;
          this.compilerBinding = this.methodBinding;
          return;
View Full Code Here

    if (binding instanceof FieldBinding) {
      FieldBinding fieldBinding = (FieldBinding) binding;
      if (!fieldBinding.isStatic()) return;
      refBinding = fieldBinding.declaringClass;
    } else if (binding instanceof MethodBinding) {
      MethodBinding methodBinding = (MethodBinding) binding;
      if (!methodBinding.isStatic()) return;
      refBinding = methodBinding.declaringClass;
    } else if (binding instanceof MemberTypeBinding) {
      MemberTypeBinding memberBinding = (MemberTypeBinding) binding;
      if (!memberBinding.isStatic()) return;
    }
View Full Code Here

   * @see org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter#disallowedTargetForAnnotation(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation)
   */
  public void disallowedTargetForAnnotation(Annotation annotation) {
    // if the annotation's recipient is an ITD, it might be allowed after all...
    if (annotation.recipient instanceof MethodBinding) {
      MethodBinding binding = (MethodBinding) annotation.recipient;
      String name = new String(binding.selector);
      if (name.startsWith("ajc$")) {
        long metaTagBits = annotation.resolvedType.getAnnotationTagBits(); // could be forward reference
        if (name.indexOf("interField") != -1) {
          if ((metaTagBits & TagBits.AnnotationForField) != 0) return;
View Full Code Here

    /**
     * Overrides the implementation in ProblemReporter and is ITD aware.
     * To report a *real* problem with an ITD marked @override, the other methodMustOverride() method is used.
     */
    public void methodMustOverride(AbstractMethodDeclaration method) {
      MethodBinding binding = method.binding;
     
      // ignore ajc$ methods
      if (new String(method.selector).startsWith("ajc$")) return;
    ResolvedMember possiblyErroneousRm = factory.makeResolvedMember(method.binding);
     
View Full Code Here

  public void endVisit(MessageSend call, BlockScope scope) {
    //System.out.println("endVisit: " + call);
    // an error has already occurred
    if (call.codegenBinding == null) return;
   
    MethodBinding superBinding = call.codegenBinding;
    if (superBinding instanceof ProblemMethodBinding) {
      return;
    }
    // InterTypeMethodBindings are always statically bound, so there's no
    // need to treat super calls specially here
    if (superBinding instanceof InterTypeMethodBinding) {
      return;
//      InterTypeMethodBinding m = (InterTypeMethodBinding)superBinding;
//      if (m.postDispatchMethod != null) {
//        call.binding = m.postDispatchMethod;
//      }
//      return;
    }

      EclipseFactory factory = ((AjLookupEnvironment)method.scope.environment()).factory;

    char[] accessName;
    if (call.isSuperAccess() && !call.binding.isStatic()) {
      call.receiver = new ThisReference(call.receiver.sourceStart, call.receiver.sourceEnd);
      accessName =
        NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
    } else if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
      //XXX this is a hack that violates some binary compatibility rules
      if (superBinding.declaringClass.equals(targetClass)) {
        accessName =
          NameMangler.protectedDispatchMethod(factory.fromBinding(targetClass),
                new String(superBinding.selector)).toCharArray();
      } else {
        accessName =
        NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
      }
    } else {
      return;
    }
   
    //??? do we want these to be unique
    MethodBinding superAccessBinding =
      new MethodBinding(ASTNode.AccPublic, accessName,
      superBinding.returnType, superBinding.parameters, superBinding.thrownExceptions,
      targetClass);
     
    AstUtil.replaceMethodBinding(call, superAccessBinding);
 
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.