Examples of ProblemMethodBinding


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

// Internal use only
public MethodBinding findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {
  MethodBinding methodBinding = super.findMethod(receiverType, selector, argumentTypes, invocationSite);
  if (methodBinding != null && methodBinding.isValidBinding())
    if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
      return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotVisible);
  return methodBinding;
}
View Full Code Here

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

  }

  // answers closest approximation, may not check argumentTypes or visibility
  methodBinding = findMethod(object, selector, argumentTypes, invocationSite);
  if (methodBinding == null)
    return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
  if (methodBinding.isValidBinding()) {
      MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
      if (compatibleMethod == null)
      return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotFound);
      methodBinding = compatibleMethod;
    if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
      return new ProblemMethodBinding(methodBinding, selector, methodBinding.parameters, ProblemReasons.NotVisible);
  }
  return methodBinding;
}
View Full Code Here

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

      return methodBinding;
    }
  }
  MethodBinding[] methods = receiverType.getMethods(TypeConstants.INIT);
  if (methods == Binding.NO_METHODS) {
    return new ProblemMethodBinding(TypeConstants.INIT, argumentTypes, ProblemReasons.NotFound);
  }
  MethodBinding[] compatible = new MethodBinding[methods.length];
  int compatibleIndex = 0;
  for (int i = 0, length = methods.length; i < length; i++) {
      MethodBinding compatibleMethod = computeCompatibleMethod(methods[i], argumentTypes, invocationSite);
    if (compatibleMethod != null)
      compatible[compatibleIndex++] = compatibleMethod;
  }
  if (compatibleIndex == 0)
    return new ProblemMethodBinding(TypeConstants.INIT, argumentTypes, ProblemReasons.NotFound); // need a more descriptive error... cannot convert from X to Y

  MethodBinding[] visible = new MethodBinding[compatibleIndex];
  int visibleIndex = 0;
  for (int i = 0; i < compatibleIndex; i++) {
    MethodBinding method = compatible[i];
    if (canBeSeenByForCodeSnippet(method, receiverType, invocationSite, this)) {
      visible[visibleIndex++] = method;
    }
  }
  if (visibleIndex == 1) {
    return visible[0];
  }
  if (visibleIndex == 0) {
    return new ProblemMethodBinding(compatible[0], TypeConstants.INIT, compatible[0].parameters, ProblemReasons.NotVisible);
  }
  return mostSpecificClassMethodBinding(visible, visibleIndex, invocationSite);
}
View Full Code Here

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

  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

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

// Internal use only
public MethodBinding findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {
  MethodBinding methodBinding = super.findMethod(receiverType, selector, argumentTypes, invocationSite);
  if (methodBinding != null && methodBinding.isValidBinding())
    if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
      return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotVisible);
  return methodBinding;
}
View Full Code Here

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

  }

  // answers closest approximation, may not check argumentTypes or visibility
  methodBinding = findMethod(object, selector, argumentTypes, invocationSite);
  if (methodBinding == null)
    return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
  if (methodBinding.isValidBinding()) {
      MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
      if (compatibleMethod == null)
      return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotFound);
      methodBinding = compatibleMethod;
    if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
      return new ProblemMethodBinding(methodBinding, selector, methodBinding.parameters, ProblemReasons.NotVisible);
  }
  return methodBinding;
}
View Full Code Here

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

      return methodBinding;
    }
  }
  MethodBinding[] methods = receiverType.getMethods(TypeConstants.INIT);
  if (methods == Binding.NO_METHODS) {
    return new ProblemMethodBinding(TypeConstants.INIT, argumentTypes, ProblemReasons.NotFound);
  }
  MethodBinding[] compatible = new MethodBinding[methods.length];
  int compatibleIndex = 0;
  for (int i = 0, length = methods.length; i < length; i++) {
      MethodBinding compatibleMethod = computeCompatibleMethod(methods[i], argumentTypes, invocationSite);
    if (compatibleMethod != null)
      compatible[compatibleIndex++] = compatibleMethod;
  }
  if (compatibleIndex == 0)
    return new ProblemMethodBinding(TypeConstants.INIT, argumentTypes, ProblemReasons.NotFound); // need a more descriptive error... cannot convert from X to Y

  MethodBinding[] visible = new MethodBinding[compatibleIndex];
  int visibleIndex = 0;
  for (int i = 0; i < compatibleIndex; i++) {
    MethodBinding method = compatible[i];
    if (canBeSeenByForCodeSnippet(method, receiverType, invocationSite, this)) {
      visible[visibleIndex++] = method;
    }
  }
  if (visibleIndex == 1) {
    return visible[0];
  }
  if (visibleIndex == 0) {
    return new ProblemMethodBinding(compatible[0], TypeConstants.INIT, compatible[0].parameters, ProblemReasons.NotVisible);
  }
  return mostSpecificClassMethodBinding(visible, visibleIndex, invocationSite);
}
View Full Code Here

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

  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

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

  int id = IProblem.UndefinedConstructor; //default...
    MethodBinding shownConstructor = targetConstructor;
  switch (targetConstructor.problemId()) {
    case ProblemReasons.NotFound :
      ProblemMethodBinding problemConstructor = (ProblemMethodBinding) targetConstructor;
      if (problemConstructor.closestMatch != null) {
          if ((problemConstructor.closestMatch.tagBits & TagBits.HasMissingType) != 0) {
          missingTypeInConstructor(statement, problemConstructor.closestMatch);
          return;
          }
View Full Code Here

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

            messageSend.receiver.sourceStart,
            messageSend.receiver.sourceEnd);
          return;
      }
      id = IProblem.UndefinedMethod;
      ProblemMethodBinding problemMethod = (ProblemMethodBinding) method;
      if (problemMethod.closestMatch != null) {
            shownMethod = problemMethod.closestMatch;
            if ((shownMethod.tagBits & TagBits.HasMissingType) != 0) {
            missingTypeInMethod(messageSend, shownMethod);
            return;
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.