Examples of ProblemMethodBinding


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

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

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

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

      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

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

        this.actualMethodBinding = new MethodBinding(this.binding.modifiers, this.binding.selector, this.binding.returnType,
            this.binding instanceof SyntheticMethodBinding ? this.descriptor.parameters : this.binding.parameters,  // retain any faults in parameter list.
                this.binding.thrownExceptions, this.binding.declaringClass);
        this.actualMethodBinding.tagBits = this.binding.tagBits;
      } else {
        this.actualMethodBinding = new ProblemMethodBinding(CharOperation.NO_CHAR, null, ProblemReasons.NoSuchSingleAbstractMethod);
      }
    }
    return this.actualMethodBinding;
  }
View Full Code Here

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

    SearchContradictions searchContradiction = new SearchContradictions();
    TypeBindingVisitor.visit(searchContradiction, method.returnType);
    if (searchContradiction.typeWithContradiction != null) {
      if (scope == null)
        return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);
      scope.problemReporter().contradictoryNullAnnotationsInferred(method, invocationSite);
      // note: if needed, we might want to update the method by removing the contradictory annotations??
      return method;
    }

    Expression[] arguments = null;
    if (invocationSite instanceof Invocation)
      arguments = ((Invocation)invocationSite).arguments();
    for (int i = 0; i < method.parameters.length; i++) {
      TypeBindingVisitor.visit(searchContradiction, method.parameters[i]);
      if (searchContradiction.typeWithContradiction != null) {
        if (scope == null)
          return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);
        if (arguments != null && i < arguments.length)
          scope.problemReporter().contradictoryNullAnnotationsInferred(method, arguments[i]);
        else
          scope.problemReporter().contradictoryNullAnnotationsInferred(method, invocationSite);
        return method;
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.