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

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


  }

  // 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

      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

  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

  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

            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

      sourceStart = allocation.enumConstant.sourceStart;
      sourceEnd = allocation.enumConstant.sourceEnd;
    }
  }
  int id = IProblem.JavadocUndefinedConstructor; //default...
  ProblemMethodBinding problemConstructor = null;
  MethodBinding shownConstructor = null;
  switch (targetConstructor.problemId()) {
    case ProblemReasons.NotFound :
      id = IProblem.JavadocUndefinedConstructor;
      break;
View Full Code Here

*   - ReceiverTypeNotVisible :
*/
public void javadocInvalidMethod(MessageSend messageSend, MethodBinding method, int modifiers) {
  if (!javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) return;
  // set problem id
  ProblemMethodBinding problemMethod = null;
  MethodBinding shownMethod = null;
  int id = IProblem.JavadocUndefinedMethod; //default...
  switch (method.problemId()) {
    case ProblemReasons.NotFound :
      id = IProblem.JavadocUndefinedMethod;
View Full Code Here

  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

            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

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

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.