Class ParameterizedGenericMethodBinding

All Implemented Interfaces:
Substitution
Direct Known Subclasses:
PolyParameterizedGenericMethodBinding

public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution
Binding denoting a generic method after type parameter substitutions got performed. On parameterized type bindings, all methods got substituted, regardless whether their signature did involve generics or not, so as to get the proper declaringClass for these methods.
  • Field Details

    • typeArguments

      public TypeBinding[] typeArguments
    • environment

      protected LookupEnvironment environment
    • inferredReturnType

      public boolean inferredReturnType
    • wasInferred

      public boolean wasInferred
    • isRaw

      public boolean isRaw
    • inferredWithUncheckedConversion

      public boolean inferredWithUncheckedConversion
    • targetType

      public TypeBinding targetType
  • Constructor Details

    • ParameterizedGenericMethodBinding

      public ParameterizedGenericMethodBinding(MethodBinding originalMethod, RawTypeBinding rawType, LookupEnvironment environment)
      Create raw generic method for raw type (double substitution from type vars with raw type arguments, and erasure of method variables) Only invoked for non-static generic methods of raw type
    • ParameterizedGenericMethodBinding

      public ParameterizedGenericMethodBinding(MethodBinding originalMethod, TypeBinding[] typeArguments, LookupEnvironment environment, boolean inferredWithUncheckConversion, boolean hasReturnProblem, TypeBinding targetType)
      Create method of parameterized type, substituting original parameters with type arguments.
  • Method Details

    • computeCompatibleMethod

      public static MethodBinding computeCompatibleMethod(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite)
      Perform inference of generic method type parameters and/or expected type

      In 1.8+ if the expected type is not yet available due to this call being an argument to an outer call which is not overload-resolved yet, the returned method binding will be a PolyParameterizedGenericMethodBinding.

    • computeCompatibleMethod18

      public static MethodBinding computeCompatibleMethod18(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite)
    • computeUniqueKey

      public char[] computeUniqueKey(boolean isLeaf)
      Overrides:
      computeUniqueKey in class MethodBinding
    • environment

      public LookupEnvironment environment()
      Description copied from interface: Substitution
      Returns the lookup environment
      Specified by:
      environment in interface Substitution
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.lookup.Substitution#environment()
    • hasSubstitutedParameters

      public boolean hasSubstitutedParameters()
      Returns true if some parameters got substituted. NOTE: generic method invocation delegates to its declaring method (could be a parameterized one)
      Overrides:
      hasSubstitutedParameters in class ParameterizedMethodBinding
    • hasSubstitutedReturnType

      public boolean hasSubstitutedReturnType()
      Returns true if the return type got substituted. NOTE: generic method invocation delegates to its declaring method (could be a parameterized one)
      Overrides:
      hasSubstitutedReturnType in class ParameterizedMethodBinding
    • isParameterizedGeneric

      public boolean isParameterizedGeneric()
      Overrides:
      isParameterizedGeneric in class MethodBinding
    • isRawSubstitution

      public boolean isRawSubstitution()
      Description copied from interface: Substitution
      Returns true for raw substitution
      Specified by:
      isRawSubstitution in interface Substitution
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.lookup.Substitution#isRawSubstitution()
    • substitute

      public TypeBinding substitute(TypeVariableBinding originalVariable)
      Description copied from interface: Substitution
      Returns the type substitute for a given type variable, or itself if no substitution got performed.
      Specified by:
      substitute in interface Substitution
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.lookup.Substitution#substitute(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding)
    • tiebreakMethod

      public MethodBinding tiebreakMethod()
      Description copied from class: MethodBinding
      Returns the method to use during tiebreak (usually the method itself). For generic method invocations, tiebreak needs to use generic method with erasure substitutes.
      Overrides:
      tiebreakMethod in class MethodBinding
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.lookup.MethodBinding#tiebreakMethod()
    • genericMethod

      public MethodBinding genericMethod()
      Overrides:
      genericMethod in class MethodBinding
    • alwaysNeedsAccessMethod

      public boolean alwaysNeedsAccessMethod()
      Description copied from class: MethodBinding
      Subtypes can override this to return true if an access method should be used when referring to this method binding. Currently used for AspectJ's inter-type method declarations.
      Overrides:
      alwaysNeedsAccessMethod in class ParameterizedMethodBinding
    • getAccessMethod

      public MethodBinding getAccessMethod(boolean staticReference)
      Description copied from class: MethodBinding
      This will only be called if alwaysNeedsAccessMethod() returns true. In that case it should return the access method to be used.
      Overrides:
      getAccessMethod in class ParameterizedMethodBinding