Class ParameterizedGenericMethodBinding
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Substitution
Substitution.NullSubstitutionModifier and TypeInterfaceDescriptionstatic classDon't substitute any type variables. -
Field Summary
FieldsFields inherited from class ParameterizedMethodBinding
originalMethodFields inherited from class MethodBinding
binaryPreviewAnnotation, declaringClass, defaultNullness, modifiers, PARAM_MISSING_OWNING_ANN, PARAM_NONNULL, PARAM_NOTOWNING, PARAM_NULLABLE, PARAM_NULLITY, PARAM_OWNING, parameterFlowBits, parameterNames, parameters, receiver, returnType, selector, thrownExceptions, typeAnnotations, typeVariablesModifier and TypeFieldDescriptionintintstatic bytestatic bytestatic bytestatic bytestatic bytestatic bytebyte[]Store flow-related information from declaration annotations (nullness and owning) (incl.char[][]Store parameter names from MethodParameters attribute (incl.char[]protected AnnotationBinding[]Fields inherited from class Binding
ANY_EXCEPTION, ARRAY_TYPE, AWAITED_ANNOTATIONS, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationRecordComponent, DefaultLocationReturnType, DefaultLocationsForTrueValue, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, extendedTagBits, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_TYPE, INTERSECTION_TYPE18, LOCAL, METHOD, MODULE, NO_ANNOTATIONS, NO_COMPONENTS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_MODULES, NO_NULL_DEFAULT, NO_PACKAGES, NO_PARAMETER_NAMES, NO_PARAMETERS, NO_PERMITTED_TYPES, NO_PLAIN_PACKAGES, NO_REFERENCE_TYPES, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, NULL_UNSPECIFIED_BY_DEFAULT, NullnessDefaultMASK, PACKAGE, PARAMETERIZED_TYPE, PATTERN, POLY_TYPE, RAW_TYPE, RECORD_COMPONENT, tagBits, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_COMPONENTS, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPEModifier and TypeFieldDescriptionstatic final ReferenceBinding[]static final intstatic final AnnotationBinding[]static final intstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#ARRAY_CONTENTSstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#FIELDstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#PARAMETERstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#RECORD_COMPONENTstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#RETURN_TYPEstatic final intstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#TYPE_ARGUMENTstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#TYPE_BOUNDstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#TYPE_PARAMETERintstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final AnnotationBinding[]static final RecordComponentBinding[]static final ElementValuePair[]static final ReferenceBinding[]static final FieldBinding[]static final ReferenceBinding[]static final MethodBinding[]static final ModuleBinding[]static final intstatic final PackageBinding[]static final char[][]static final TypeBinding[]static final ReferenceBinding[]static final PlainPackageBinding[]static final ReferenceBinding[]static final ReferenceBinding[]static final TypeVariableBinding[]static final TypeBinding[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intlongstatic final intstatic final intstatic final intstatic final RecordComponentBinding[]static final FieldBinding[]static final MethodBinding[]static final ReferenceBinding[]static final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionParameterizedGenericMethodBinding(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 typeParameterizedGenericMethodBinding(MethodBinding originalMethod, TypeBinding[] typeArguments, LookupEnvironment environment, boolean inferredWithUncheckConversion, boolean hasReturnProblem, TypeBinding targetType) Create method of parameterized type, substituting original parameters with type arguments. -
Method Summary
Modifier and TypeMethodDescriptionbooleanSubtypes can override this to return true if an access method should be used when referring to this method binding.static MethodBindingcomputeCompatibleMethod(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite) Perform inference of generic method type parameters and/or expected typestatic MethodBindingcomputeCompatibleMethod18(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite) char[]computeUniqueKey(boolean isLeaf) Returns the lookup environmentgetAccessMethod(boolean staticReference) This will only be called if alwaysNeedsAccessMethod() returns true.booleanReturns true if some parameters got substituted.booleanReturns true if the return type got substituted.booleanbooleanReturns true for raw substitutionsubstitute(TypeVariableBinding originalVariable) Returns the type substitute for a given type variable, or itself if no substitution got performed.Methods inherited from class ParameterizedMethodBinding
canBeSeenBy, copy, instantiateGetClass, original, shallowOriginal, sourceMethodModifier and TypeMethodDescriptionbooleancanBeSeenBy(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) copy()static ParameterizedMethodBindinginstantiateGetClass(TypeBinding receiverType, MethodBinding originalMethod, Scope scope) The type of x.getClass() is substituted from'Class<? extends Object>'into:'Class<? extends raw(X)>original()Returns the original method (as opposed to parameterized instances)Strips one level of parameterization, so if both class and method are parameterized, leave the class parameters in place.Methods inherited from class MethodBinding
areParameterErasuresEqual, areParametersCompatibleWith, areParametersEqual, areTypeVariableErasuresEqual, asRawMethod, canBeSeenBy, canBeSeenBy, collectMissingTypes, computeSignature, computeSubstitutedMethod, constantPoolName, copyFieldsFrom, doesParameterLengthMatch, fillInDefaultNonNullness, fillInDefaultNonNullness18, findOriginalInheritedMethod, findPrivilegedBinding, flowBitFromAnnotationTagBit, genericSignature, getAccessFlags, getAllTypeVariables, getAnnotations, getAnnotationTagBits, getDefaultValue, getParameterAnnotations, getParameterNullness, getTypeAnnotations, getTypeVariable, getVisibleBinding, getVisibleBinding, hasNonNullDefaultForParameter, hasNonNullDefaultForReturnType, hasNonNullDefaultForType, hasPolymorphicSignature, isAbstract, isAsVisible, isBridge, isCandindateMain, isCanonicalConstructor, isClosingMethod, isCompactConstructor, isConstructor, isDefault, isDefaultAbstract, isDefaultMethod, isDeprecated, isFinal, isImplementing, isMain, isNative, isOrEnclosedByPrivateType, isOverriding, isPolymorphic, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isSynthetic, isUsed, isVarargs, isVoidMethod, isWellknownMethod, isWellknownMethod, kind, markMissingOwningAnnotationOnParameter, notownsParameter, ownsParameter, parameterHasMissingOwningAnnotation, readableName, redeclaresPublicObjectMethod, setAnnotations, setAnnotations, setDefaultValue, setParameterAnnotations, setSelector, setTypeAnnotations, shortReadableName, signature, signature, sourceEnd, sourceLambda, sourceRecordComponent, sourceStart, toString, typeVariables, verifyOverrideCompatibilityModifier and TypeMethodDescriptionfinal booleanfinal booleanareParametersCompatibleWith(TypeBinding[] arguments) final booleanareParametersEqual(MethodBinding method) final booleanbooleancanBeSeenBy(InvocationSite invocationSite, Scope scope) final booleancanBeSeenBy(PackageBinding invocationPackage) collectMissingTypes(List<TypeBinding> missingTypes, boolean considerReturnType) final char[]computeSignature(ClassFile classFile) computeSubstitutedMethod(MethodBinding method, LookupEnvironment env) final char[]protected voidcopyFieldsFrom(MethodBinding other) booleandoesParameterLengthMatch(int suggestedParameterLength) protected voidfillInDefaultNonNullness(AbstractMethodDeclaration sourceMethod, boolean needToApplyReturnNonNullDefault, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterNonNullDefaultProvider needToApplyParameterNonNullDefault) After method verifier has finished, fill in missing @NonNull specification from the applicable default.protected voidfillInDefaultNonNullness18(AbstractMethodDeclaration sourceMethod, LookupEnvironment env) findOriginalInheritedMethod(MethodBinding inheritedMethod) findPrivilegedBinding(SourceTypeBinding invocationType, InvocationSite location) static byteflowBitFromAnnotationTagBit(long tagBit) char[]<typeParam1 ... typeParamM>(param1 ... paramN)returnType thrownException1 ... thrownExceptionP T foo(T t) throws X<T> ---> (TT;)TT;LX<TT;>; void bar(X<T> t) --> (LX<TT;>;)V <T> void bar(X<T> t) --> <T:Ljava.lang.Object;>(LX<TT;>;)Vfinal intgetAllTypeVariables(boolean isDiamond) longCompute the tagbits for standard annotations.getParameterNullness(int idx) final AnnotationBinding[]getTypeVariable(char[] variableName) getVisibleBinding(InvocationSite invocationSite, Scope scope) getVisibleBinding(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterNonNullDefaultProviderbooleanprotected booleanhasNonNullDefaultForType(TypeBinding type, int location, AbstractMethodDeclaration srcMethod, int start) booleanhasPolymorphicSignature(Scope scope) Identifies whether the method has Polymorphic signature based on jls-15.12.3
Definition reproduced here.final booleanbooleanisAsVisible(ReferenceBinding declaringType) final booleanisBridge()final booleanfinal booleanbooleanfinal booleanfinal booleanfinal booleanfinal booleanbooleanfinal booleanbooleanisFinal()final booleanfinal booleanisMain()final booleanisNative()final booleanfinal booleanbooleanfinal booleanfinal booleanfinal booleanisPublic()final booleanisStatic()final booleanfinal booleanfinal booleanfinal booleanisUsed()booleanbooleanbooleanisWellknownMethod(char[][] compoundClassName, char[] wellKnownSelector) booleanisWellknownMethod(int typeId, char[] wellKnownSelector) final intkind()voidmarkMissingOwningAnnotationOnParameter(int rank) booleannotownsParameter(int i) booleanownsParameter(int i) booleanparameterHasMissingOwningAnnotation(int rank) char[]booleanvoidsetAnnotations(AnnotationBinding[] annotations, boolean forceStore) voidsetAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) voidsetDefaultValue(Object defaultValue) voidsetParameterAnnotations(AnnotationBinding[][] parameterAnnotations) protected final voidsetSelector(char[] selector) voidsetTypeAnnotations(AnnotationBinding[] annotations) char[]final char[]char[]final intfinal inttoString()voidverifyOverrideCompatibility(MethodBinding inheritedMethod, ClassScope scope) Methods inherited from class Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isAnnotationType, isParameter, isPatternVariable, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotationsModifier and TypeMethodDescriptionchar[]voidCompute the tag bits for @Deprecated annotations, avoiding resolving entire annotation if not necessary.booleanbooleanbooleanbooleanstatic booleanfinal booleanbooleanintvoidsetAnnotations(AnnotationBinding[] annotations, Scope scope, boolean forceStore)
-
Field Details
-
typeArguments
-
environment
-
wasInferred
public boolean wasInferred -
isRaw
public boolean isRaw -
inferredWithUncheckedConversion
public boolean inferredWithUncheckedConversion -
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 typeIn 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:
computeUniqueKeyin classMethodBinding
-
environment
Description copied from interface:SubstitutionReturns the lookup environment- Specified by:
environmentin interfaceSubstitution- See Also:
-
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:
hasSubstitutedParametersin classParameterizedMethodBinding
-
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:
hasSubstitutedReturnTypein classParameterizedMethodBinding
-
isParameterizedGeneric
public boolean isParameterizedGeneric()- Overrides:
isParameterizedGenericin classMethodBinding
-
isRawSubstitution
public boolean isRawSubstitution()Description copied from interface:SubstitutionReturns true for raw substitution- Specified by:
isRawSubstitutionin interfaceSubstitution- See Also:
-
substitute
Description copied from interface:SubstitutionReturns the type substitute for a given type variable, or itself if no substitution got performed.- Specified by:
substitutein interfaceSubstitution- See Also:
-
genericMethod
- Overrides:
genericMethodin classMethodBinding
-
alwaysNeedsAccessMethod
public boolean alwaysNeedsAccessMethod()Description copied from class:MethodBindingSubtypes 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:
alwaysNeedsAccessMethodin classParameterizedMethodBinding
-
getAccessMethod
Description copied from class:MethodBindingThis will only be called if alwaysNeedsAccessMethod() returns true. In that case it should return the access method to be used.- Overrides:
getAccessMethodin classParameterizedMethodBinding
-