org.aspectj.org.eclipse.jdt.internal.compiler.lookup
Class ParameterizedGenericMethodBinding

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
      extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding
          extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding
              extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding
All Implemented Interfaces:
Substitution

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 Summary
 boolean inferredReturnType
           
 boolean isRaw
           
 TypeBinding[] typeArguments
           
 boolean wasInferred
           
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding
originalMethod
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding
declaringClass, defaultNullness, modifiers, parameterNames, parameterNonNullness, parameters, receiver, returnType, selector, tagBits, thrownExceptions, typeVariables
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
ANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationReturnType, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_CAST_TYPE, INTERSECTION_TYPE, LOCAL, METHOD, NO_ANNOTATIONS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_NULL_DEFAULT, NO_PARAMETER_NAMES, NO_PARAMETERS, NO_REFERENCE_TYPES, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, NONNULL_BY_DEFAULT, NULL_UNSPECIFIED_BY_DEFAULT, NullnessDefaultMASK, PACKAGE, PARAMETERIZED_TYPE, POLY_TYPE, RAW_TYPE, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE
 
Constructor Summary
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(MethodBinding originalMethod, TypeBinding[] typeArguments, LookupEnvironment environment)
          Create method of parameterized type, substituting original parameters with type arguments.
 
Method Summary
 boolean alwaysNeedsAccessMethod()
          Subtypes can override this to return true if an access method should be used when referring to this method binding.
static MethodBinding computeCompatibleMethod(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite, int inferenceLevel)
          Perform inference of generic method type parameters and/or expected type
 char[] computeUniqueKey(boolean isLeaf)
           
 LookupEnvironment environment()
          Returns the lookup environment
 MethodBinding genericMethod()
           
 MethodBinding getAccessMethod(boolean staticReference)
          This will only be called if alwaysNeedsAccessMethod() returns true.
 boolean hasSubstitutedParameters()
          Returns true if some parameters got substituted.
 boolean hasSubstitutedReturnType()
          Returns true if the return type got substituted.
 boolean isRawSubstitution()
          Returns true for raw substitution
 TypeBinding substitute(TypeVariableBinding originalVariable)
          Returns the type substitute for a given type variable, or itself if no substitution got performed.
 MethodBinding tiebreakMethod()
          Returns the method to use during tiebreak (usually the method itself).
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding
canBeSeenBy, instantiateGetClass, original, shallowOriginal, sourceMethod
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding
areParameterErasuresEqual, areParametersCompatibleWith, areParametersEqual, areTypeVariableErasuresEqual, asRawMethod, canBeSeenBy, canBeSeenBy, collectMissingTypes, constantPoolName, fillInDefaultNonNullness, fillInDefaultNonNullness18, findOriginalInheritedMethod, findPrivilegedBinding, genericSignature, getAccessFlags, getAnnotations, getAnnotationTagBits, getDefaultValue, getParameterAnnotations, getTypeVariable, getVisibleBinding, getVisibleBinding, hasNonNullDefaultFor, isAbstract, isBridge, isConstructor, isDefault, isDefaultAbstract, isDefaultMethod, isDeprecated, isFinal, isImplementing, isMain, isNative, isOrEnclosedByPrivateType, isOverriding, isPolymorphic, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isSynthetic, isUsed, isVarargs, isViewedAsDeprecated, isVoidMethod, kind, readableName, redeclaresPublicObjectMethod, setAnnotations, setAnnotations, setDefaultValue, setParameterAnnotations, setSelector, shortReadableName, signature, signature, sourceEnd, sourceLambda, sourceStart, toString, typeVariables
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isAnnotationType, isParameter, isTaggedRepeatable, isValidBinding, isVolatile, problemId, setAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

typeArguments

public TypeBinding[] typeArguments

inferredReturnType

public boolean inferredReturnType

wasInferred

public boolean wasInferred

isRaw

public boolean isRaw
Constructor Detail

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)
Create method of parameterized type, substituting original parameters with type arguments.

Method Detail

computeCompatibleMethod

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

In 1.8+ the following discipline has to be observed by callers: Each invocation must be subjected to two levels of inference:

Clients can control which parts of the inference should be performed by passing the appropriate flags into argument 'inferenceLevel'. On each call path it must be ensured that one or more invocation applicability inferences are always followed by exactly one invocation type inference (unless errors have been detected).

Initial clients are the direct callers of Scope.computeCompatibleMethod(MethodBinding,TypeBinding[],InvocationSite,int), which should either invoke both levels of inference or delegate the second part to Scope.mostSpecificMethodBinding(MethodBinding[],int,TypeBinding[],InvocationSite,ReferenceBinding), which is intended to ensure completing the inference on all non-error exits.


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

isRawSubstitution

public boolean isRawSubstitution()
Description copied from interface: Substitution
Returns true for raw substitution

Specified by:
isRawSubstitution in interface Substitution
See Also:
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:
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:
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