Class WildcardBinding
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding
-
Field Summary
FieldsModifier and TypeFieldDescriptionintintFields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
compoundName, fPackage, LUB_GENERIC, modifiers, samProblemBinding, singleAbstractMethod, sourceNameFields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
BOOLEAN, BYTE, CHAR, DOUBLE, extendedTagBits, FLOAT, id, INT, LONG, NULL, NUMERIC_TYPES, SHORT, tagBits, TYPE_USE_BINDING, typeAnnotations, VOIDFields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
ANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationReturnType, DefaultLocationsForTrueValue, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, 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, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_COMPONENTS, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionWildcardBinding(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, LookupEnvironment environment) When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound lazily) -
Method Summary
Modifier and TypeMethodDescriptionbooleanUsed to implement this sentence from o.e.j.annotation.DefaultLocation: "Wildcards and the use of type variables are always excluded from NonNullByDefault."booleanboundCheck(TypeBinding argumentType) Returns true if the argument type satisfies the wildcard bound(s)booleanAnswer true if the receiver can be instantiatedclone(TypeBinding immaterial) Virtual copy constructor: a copy is made of the receiver's entire instance state and then suitably parameterized by the arguments to the clone operation as seen fit by each type.collectMissingTypes(List<TypeBinding> missingTypes) Iterate through the type components to collect instances of leaf missing typesvoidcollectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint) Collect the substitutes into a map for certain type variables inside the receiver type e.g.char[]computeUniqueKey(boolean isLeaf) p.X<T extends Y & I, U extends Y> -> Lp/X<TT;TU;>;char[]Answer the receiver's constant pool name.longdetermineNullBitsFromDeclaration(Scope scope, Wildcard wildcard) compute the nullTagBits from type annotations and bound.booleanCall this before descending into type details to prevent infinite recursion.erasure()voidevaluateNullAnnotations(Scope scope, Wildcard wildcard) evaluate null type annotations and check / copy nullTagBits from bound and typevariable.voidExit the context of a potentially recursive function.char[]Answer the receiver classfile signature.inthashCode()booleanhasTypeBit(int bit) Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable.booleanReturns true if the type hierarchy is connectedbooleanReturns true if the current type denotes an intersection type: Number andComparable<?>booleanDoes this type lack a class file representation on its own ?booleanisProperType(boolean admitCapture18) JLS8 Sect 18.1.1booleanisSuperclassOf(ReferenceBinding otherType) Answer true if the receiver is in the superclass hierarchy of aType NOTE: Object.isSuperclassOf(Object) -> falsebooleanReturns true if wildcard type of the form '?' (no bound)booleanReturns true if the type is a wildcardintkind()booleanmentionsAny(TypeBinding[] parameters, int idx) Does this type mention any of the given type parameters, except the one at position 'idx'?char[]nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) Answer a readable name (for error reporting) that includes nullness type annotations.char[]Answer the receiver's signature.voidsetTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) char[]char[]Answer the receiver classfile signature.char[]voidswapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env) toString()Returns associated type variable, or null in case of inconsistencyReturn this type minus its type annotationsPerform capture "deconversion" on a given typelongRefresh some tagBits from details into the main type.Return this type minus its toplevel null annotations.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
appendNullAnnotation, applyCloseableClassWhitelists, applyCloseableInterfaceWhitelists, applyCloseableWhitelists, availableFields, availableMethods, binarySearch, binarySearch, canBeSeenBy, canBeSeenBy, canBeSeenBy, computeGenericTypeSignature, computeId, computeId, depth, detectAnnotationCycle, detectWrapperResource, downwardsProjection, enclosingTypeAt, enumConstantCount, fieldCount, getAccessFlags, getAllEnumerableAvatars, getAnnotations, getAnnotationTagBits, getComponent, getEnclosingInstancesSlotSize, getExactConstructor, getExactMethod, getField, getField, getFileName, getInterfaceAbstractContracts, getMemberType, getMethods, getMethods, getOuterLocalVariablesSlotSize, getPackage, getRecordComponent, getRecordComponentAccessor, getSingleAbstractMethod, getTypeVariable, hasEnclosingInstanceContext, hasHierarchyCheckStarted, hasIncompatibleSuperType, hasMemberTypes, hasMethodWithNumArgs, hasNullBit, hasRestrictedAccess, implementsInterface, innerCanBeSeenBy, innerCanBeSeenBy, isAbstract, isAnnotationType, isBinaryBinding, isClass, isCompatibleWith, isConsistentIntersection, isDefault, isDeprecated, isDisjointFrom, isEnum, isFieldInitializationFinished, isFinal, isFunctionalInterface, isHierarchyBeingActivelyConnected, isHierarchyBeingConnected, isImplicitType, isInterface, isNestmateOf, isNonSealed, isOrEnclosedByPrivateType, isPrivate, isProtected, isPublic, isSealed, isStatic, isStrictfp, isSubtypeOf, isSubTypeOfRTL, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, memberTypes, methods, module, outermostEnclosingType, qualifiedSourceName, readableName, retrieveAnnotationHolder, setAnnotations, setContainerAnnotationType, setHierarchyCheckDone, shortReadableName, sortFields, sortMethods, syntheticEnclosingInstanceTypes, tagAsHavingDefectiveContainerType, unResolvedComponents, unResolvedFields, upwardsProjectionMethods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
capture, closestMatch, components, containerAnnotationType, dimensions, enclosingMethod, enclosingType, equalsEquals, fields, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, getErasureCompatibleType, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, hasValueBasedTypeAnnotation, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxedPrimitiveType, isBoxingCompatibleWith, isCapture, isCompatibleWith, isEquivalentTo, isFreeTypeVariable, isFunctionalType, isGenericType, isHierarchyInconsistent, isIntersectionType18, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPolyType, isPotentiallyCompatibleWith, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProvablyDistinct, isRawType, isReadyForAnnotations, isRecord, isRecordWithComponents, isReifiable, isRepeatableAnnotationType, isTypeArgumentContainedBy, isTypeVariable, isUnresolvedType, leafComponentType, needsUncheckedConversion, notEquals, original, permittedTypes, prototype, qualifiedPackageName, signableName, sIsMoreSpecific, syntheticOuterLocalVariables, syntheticTypeVariablesMentioned, typeVariables, unboxedType, upwardsProjection, wellKnownBaseType, wellKnownTypeMethods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isPatternVariable, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotations
-
Field Details
-
genericType
-
rank
public int rank -
bound
-
otherBounds
-
boundKind
public int boundKind
-
-
Constructor Details
-
WildcardBinding
public WildcardBinding(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, LookupEnvironment environment) When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound lazily)
-
-
Method Details
-
allBounds
-
setTypeAnnotations
- Overrides:
setTypeAnnotationsin classTypeBinding
-
evaluateNullAnnotations
evaluate null type annotations and check / copy nullTagBits from bound and typevariable. may be invoked repeatedly.- Parameters:
scope- (may be null, if wildcard is null)wildcard- (may be null. if non-null, errors are reported and type annotations are dropped from this.bound in case of conflicts.)
-
determineNullBitsFromDeclaration
compute the nullTagBits from type annotations and bound.- Parameters:
scope- (may be null, if wildcard is null)wildcard- (may be null. if non-null, errors are reported and type annotations are dropped from this.bound in case of conflicts.)
-
actualType
- Overrides:
actualTypein classReferenceBinding
-
kind
public int kind()- Overrides:
kindin classTypeBinding
-
boundCheck
Returns true if the argument type satisfies the wildcard bound(s) -
canBeInstantiated
public boolean canBeInstantiated()Description copied from class:ReferenceBindingAnswer true if the receiver can be instantiated- Overrides:
canBeInstantiatedin classReferenceBinding- See Also:
-
collectMissingTypes
Description copied from class:TypeBindingIterate through the type components to collect instances of leaf missing types- Overrides:
collectMissingTypesin classTypeBinding- Returns:
- missing types
- See Also:
-
collectSubstitutes
public void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint) Collect the substitutes into a map for certain type variables inside the receiver type e.g.Collection<T>.collectSubstitutes(Collection<List<X>>, Map)will populate Map with:T --> List<X>Constraints:A << F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EXTENDS (1)) A = F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EQUAL (0)) A >> F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_SUPER (2))- Overrides:
collectSubstitutesin classTypeBinding
-
computeUniqueKey
public char[] computeUniqueKey(boolean isLeaf) Description copied from class:ReferenceBindingp.X<T extends Y & I, U extends Y> -> Lp/X<TT;TU;>;- Overrides:
computeUniqueKeyin classReferenceBinding
-
constantPoolName
public char[] constantPoolName()Description copied from class:ReferenceBindingAnswer the receiver's constant pool name. NOTE: This method should only be used during/after code gen.- Overrides:
constantPoolNamein classReferenceBinding- See Also:
-
clone
Description copied from class:TypeBindingVirtual copy constructor: a copy is made of the receiver's entire instance state and then suitably parameterized by the arguments to the clone operation as seen fit by each type. Parameters may not make sense for every type in the hierarchy, in which case they are silently ignored. A type may choose to retain a copy of the prototype for reference.- Overrides:
clonein classTypeBinding
-
annotatedDebugName
- Overrides:
annotatedDebugNamein classTypeBinding
-
debugName
- Overrides:
debugNamein classReferenceBinding- See Also:
-
erasure
- Overrides:
erasurein classTypeBinding
-
genericTypeSignature
public char[] genericTypeSignature()Description copied from class:TypeBindingAnswer the receiver classfile signature. Arrays and base types do not distinguish between signature() and constantPoolName(). NOTE: This method should only be used during/after code gen.- Overrides:
genericTypeSignaturein classTypeBinding
-
hashCode
public int hashCode()- Overrides:
hashCodein classReferenceBinding
-
hasTypeBit
public boolean hasTypeBit(int bit) Description copied from class:TypeBindingAnswer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable.- Overrides:
hasTypeBitin classTypeBinding
-
isSuperclassOf
Description copied from class:ReferenceBindingAnswer true if the receiver is in the superclass hierarchy of aType NOTE: Object.isSuperclassOf(Object) -> false- Overrides:
isSuperclassOfin classReferenceBinding- See Also:
-
isIntersectionType
public boolean isIntersectionType()Description copied from class:TypeBindingReturns true if the current type denotes an intersection type: Number andComparable<?>- Overrides:
isIntersectionTypein classTypeBinding
-
getIntersectingTypes
- Overrides:
getIntersectingTypesin classTypeBinding
-
isHierarchyConnected
public boolean isHierarchyConnected()Description copied from class:ReferenceBindingReturns true if the type hierarchy is connected- Overrides:
isHierarchyConnectedin classReferenceBinding
-
enterRecursiveFunction
public boolean enterRecursiveFunction()Description copied from class:TypeBindingCall this before descending into type details to prevent infinite recursion.- Overrides:
enterRecursiveFunctionin classTypeBinding- Returns:
- true if a recursion was not already started.
-
exitRecursiveFunction
public void exitRecursiveFunction()Description copied from class:TypeBindingExit the context of a potentially recursive function.- Overrides:
exitRecursiveFunctionin classTypeBinding
-
isProperType
public boolean isProperType(boolean admitCapture18) Description copied from class:TypeBindingJLS8 Sect 18.1.1- Overrides:
isProperTypein classReferenceBinding- Parameters:
admitCapture18- request ifCaptureBinding18shuld be considered as a proper type. If unsure say 'true', only inScope.greaterLowerBound(TypeBinding[], Scope, LookupEnvironment)CaptureBinding18 has to be excluded to prevent an NPE on a branch that heuristically tries to avoid inconsistent intersections.
-
isUnboundWildcard
public boolean isUnboundWildcard()Description copied from class:TypeBindingReturns true if wildcard type of the form '?' (no bound)- Overrides:
isUnboundWildcardin classTypeBinding
-
isWildcard
public boolean isWildcard()Description copied from class:TypeBindingReturns true if the type is a wildcard- Overrides:
isWildcardin classTypeBinding
-
readableName
public char[] readableName()Description copied from class:ReferenceBindingAnswer the receiver's signature. NOTE: This method should only be used during/after code gen.- Overrides:
readableNamein classReferenceBinding
-
nullAnnotatedReadableName
Description copied from class:TypeBindingAnswer a readable name (for error reporting) that includes nullness type annotations.- Overrides:
nullAnnotatedReadableNamein classReferenceBinding- See Also:
-
shortReadableName
public char[] shortReadableName()- Overrides:
shortReadableNamein classReferenceBinding
-
signature
public char[] signature()Description copied from class:TypeBindingAnswer the receiver classfile signature. Arrays and base types do not distinguish between signature() and constantPoolName(). NOTE: This method should only be used during/after code gen.- Overrides:
signaturein classReferenceBinding- See Also:
-
sourceName
public char[] sourceName()- Overrides:
sourceNamein classReferenceBinding
-
superclass
- Overrides:
superclassin classReferenceBinding
-
superInterfaces
- Overrides:
superInterfacesin classReferenceBinding
-
swapUnresolved
public void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env) -
toString
-
typeVariable
Returns associated type variable, or null in case of inconsistency -
unannotated
Description copied from class:TypeBindingReturn this type minus its type annotations- Overrides:
unannotatedin classTypeBinding
-
withoutToplevelNullAnnotation
Description copied from class:TypeBindingReturn this type minus its toplevel null annotations. Any annotations on type arguments or bounds are retained.- Overrides:
withoutToplevelNullAnnotationin classTypeBinding
-
uncapture
Description copied from class:TypeBindingPerform capture "deconversion" on a given type- Overrides:
uncapturein classTypeBinding
-
mentionsAny
Description copied from class:TypeBindingDoes this type mention any of the given type parameters, except the one at position 'idx'?- Overrides:
mentionsAnyin classTypeBinding
-
acceptsNonNullDefault
public boolean acceptsNonNullDefault()Description copied from class:TypeBindingUsed to implement this sentence from o.e.j.annotation.DefaultLocation: "Wildcards and the use of type variables are always excluded from NonNullByDefault."- Overrides:
acceptsNonNullDefaultin classReferenceBinding
-
updateTagBits
public long updateTagBits()Description copied from class:TypeBindingRefresh some tagBits from details into the main type. Currently handled: TagBits.HasNullTypeAnnotation- Overrides:
updateTagBitsin classTypeBinding
-
isNonDenotable
public boolean isNonDenotable()Description copied from class:TypeBindingDoes this type lack a class file representation on its own ?- Overrides:
isNonDenotablein classTypeBinding
-