Class IntersectionTypeBinding18
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.IntersectionTypeBinding18
Abstraction used for intersection casts in Java 8 + and inferred types:
- type inference at 1.8+
- lub at 1.8+
- projections for 'var' at 10+
-
Field Summary
FieldsFields inherited from class ReferenceBinding
compoundName, DYSFUNCTIONAL_INTERFACE_EXCEPTION, fPackage, LUB_GENERIC, modifiers, samProblemBinding, singleAbstractMethod, sourceNameFields inherited from class TypeBinding
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, id, INT, LONG, NULL, NUMERIC_TYPES, SHORT, TYPE_USE_BINDING, typeAnnotations, VOIDFields inherited from class Binding
ANY_EXCEPTION, ARRAY_TYPE, 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_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionIntersectionTypeBinding18(ReferenceBinding[] intersectingTypes, LookupEnvironment environment) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAnswer true if the receiver can be instantiatedbooleancanBeSeenBy(PackageBinding invocationPackage) Answer true if the receiver is visible to the invocationPackage.booleancanBeSeenBy(ReferenceBinding receiverType, ReferenceBinding invocationType) Answer true if the receiver is visible to the receiverType and the invocationType.booleancanBeSeenBy(Scope scope) Answer true if the receiver is visible to the type provided by the scope.clone(TypeBinding enclosingType) 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.protected Stream<MethodBinding> collateFunctionalInterfaceContracts(Scope scope, boolean replaceWildcards, Set<ReferenceBinding> visitedInterfaces) char[]Answer the receiver's constant pool name.downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) Perform a downwards type projection as per JLS 4.10.5erasure()getSAMType(Scope scope) booleanhasTypeBit(int bit) Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable.booleanbooleanisCompatibleWith(TypeBinding right, Scope scope) Answer true if the receiver type can be assigned to the argument type (right) In addition to improving performance, caching also ensures there is no infinite regression since per nature, the compatibility check is recursive through parameterized type arguments (122775)booleanbooleanDoes this type lack a class file representation on its own ?booleanisProperType(boolean admitCapture18) JLS8 Sect 18.1.1booleanisSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527) intkind()booleanmentionsAny(TypeBinding[] parameters, int idx) Does this type mention any of the given type parameters, except the one at position 'idx'?char[]Answer the qualified name of the receiver's package separated by periods or an empty string if its the default package.char[]Answer the source name for the type.char[]Answer the receiver's signature.char[]char[]toString()longRefresh some tagBits from details into the main type.upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) Perform an upwards type projection as per JLS 4.10.5Methods inherited from class ReferenceBinding
acceptsNonNullDefault, actualType, appendNullAnnotation, applyCloseableClassWhitelists, applyCloseableInterfaceWhitelists, applyCloseableWhitelists, availableFields, availableMethods, binarySearch, binarySearch, computeGenericTypeSignature, computeId, computeId, computeUniqueKey, depth, detectAnnotationCycle, detectWrapperResource, enclosingTypeAt, enumConstantCount, fieldCount, getAccessFlags, getAllEnumerableAvatars, getAnnotations, getAnnotations, getAnnotationTagBits, getEnclosingInstancesSlotSize, getExactConstructor, getExactMethod, getField, getField, getFileName, getMemberType, getMethods, getMethods, getOuterLocalVariablesSlotSize, getRecordComponent, getRecordComponentAccessor, getRecordComponents, getSingleAbstractMethod, getTypeVariable, hasEnclosingInstanceContext, hashCode, hasHierarchyCheckStarted, hasIncompatibleSuperType, hasMemberTypes, hasMethodWithNumArgs, hasNullBit, hasRestrictedAccess, implementsInterface, innerCanBeSeenBy, innerCanBeSeenBy, isAbstract, isAnnotationType, isBinaryBinding, isClass, isConsistentIntersection, isDefault, isDeprecated, isDisjointFrom, isEnum, isFieldInitializationFinished, isFinal, isFunctionalInterface, isHierarchyBeingActivelyConnected, isHierarchyBeingConnected, isHierarchyConnected, isImplicitType, isInterface, isNestmateOf, isNonSealed, isOrEnclosedByPrivateType, isPrivate, isProtected, isPublic, isRecord, isSealed, isStatic, isStrictfp, isSubTypeOfRTL, isSuperclassOf, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, memberTypes, methods, module, nullAnnotatedReadableName, outermostEnclosingType, readableName, retrieveAnnotationHolder, setAnnotations, setContainerAnnotationType, setHierarchyCheckDone, shortReadableName, signature, sortFields, sortMethods, syntheticEnclosingInstanceTypes, tagAsHavingDefectiveContainerType, typeArgumentsIncludingEnclosing, typeVariablesIncludingEnclosing, unResolvedFieldsMethods inherited from class TypeBinding
annotatedDebugName, capture, closestMatch, collectMissingTypes, collectSubstitutes, components, containerAnnotationType, dimensions, enclosingMethod, enclosingType, enterRecursiveFunction, equalsEquals, exitRecursiveFunction, fields, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, genericTypeSignature, getErasureCompatibleType, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, hasValueBasedTypeAnnotation, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxingCompatibleWith, isCapture, isCompatibleWith, isEquivalentTo, isFreeTypeVariable, isFunctionalType, isGenericType, isHierarchyInconsistent, isIntersectionType, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPolyType, isPotentiallyCompatibleWith, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProvablyDistinct, isRawType, isReadyForAnnotations, isRecordWithComponents, isReifiable, isRepeatableAnnotationType, isTypeArgumentContainedBy, isTypeVariable, isUnboundWildcard, isUnresolvedType, isWildcard, leafComponentType, needsUncheckedConversion, notEquals, original, permittedTypes, prototype, setTypeAnnotations, signableName, sIsMoreSpecific, syntheticOuterLocalVariables, syntheticTypeVariablesMentioned, typeArgumentDepth, typeVariables, unannotated, unboxedType, uncapture, upwardsProjection, wellKnownBaseType, wellKnownType, withoutToplevelNullAnnotationMethods inherited from class Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isPatternVariable, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotations
-
Field Details
-
intersectingTypes
-
-
Constructor Details
-
IntersectionTypeBinding18
public IntersectionTypeBinding18(ReferenceBinding[] intersectingTypes, LookupEnvironment environment)
-
-
Method Details
-
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
-
collateFunctionalInterfaceContracts
protected Stream<MethodBinding> collateFunctionalInterfaceContracts(Scope scope, boolean replaceWildcards, Set<ReferenceBinding> visitedInterfaces) throws org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.DysfunctionalInterfaceException - Overrides:
collateFunctionalInterfaceContractsin classReferenceBinding- Throws:
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.DysfunctionalInterfaceException
-
hasTypeBit
public boolean hasTypeBit(int bit) Description copied from class:TypeBindingAnswer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable.- Overrides:
hasTypeBitin classTypeBinding
-
canBeInstantiated
public boolean canBeInstantiated()Description copied from class:ReferenceBindingAnswer true if the receiver can be instantiated- Overrides:
canBeInstantiatedin classReferenceBinding
-
canBeSeenBy
Description copied from class:ReferenceBindingAnswer true if the receiver is visible to the invocationPackage.- Overrides:
canBeSeenByin classReferenceBinding
-
canBeSeenBy
Description copied from class:ReferenceBindingAnswer true if the receiver is visible to the type provided by the scope.- Overrides:
canBeSeenByin classReferenceBinding
-
canBeSeenBy
Description copied from class:ReferenceBindingAnswer true if the receiver is visible to the receiverType and the invocationType.- Overrides:
canBeSeenByin 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
-
getPackage
- Overrides:
getPackagein classReferenceBinding
-
getIntersectingTypes
- Overrides:
getIntersectingTypesin classTypeBinding
-
superclass
- Overrides:
superclassin classReferenceBinding
-
superInterfaces
- Overrides:
superInterfacesin classReferenceBinding
-
isBoxedPrimitiveType
public boolean isBoxedPrimitiveType()- Overrides:
isBoxedPrimitiveTypein classTypeBinding
-
isCompatibleWith
Description copied from class:ReferenceBindingAnswer true if the receiver type can be assigned to the argument type (right) In addition to improving performance, caching also ensures there is no infinite regression since per nature, the compatibility check is recursive through parameterized type arguments (122775)- Overrides:
isCompatibleWithin classReferenceBinding
-
isSubtypeOf
- Overrides:
isSubtypeOfin classReferenceBinding
-
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.
-
erasure
- Overrides:
erasurein classTypeBinding
-
qualifiedPackageName
public char[] qualifiedPackageName()Description copied from class:TypeBindingAnswer the qualified name of the receiver's package separated by periods or an empty string if its the default package. For example, {java.util}.- Overrides:
qualifiedPackageNamein classTypeBinding
-
qualifiedSourceName
public char[] qualifiedSourceName()Description copied from class:ReferenceBindingAnswer the source name for the type. In the case of member types, as the qualified name from its top level type. For example, for a member type N defined insideM & A: "A.M.N".- Overrides:
qualifiedSourceNamein classReferenceBinding
-
sourceName
public char[] sourceName()- Overrides:
sourceNamein classReferenceBinding
-
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
-
shortReadableName
public char[] shortReadableName()- Overrides:
shortReadableNamein classReferenceBinding
-
isIntersectionType18
public boolean isIntersectionType18()- Overrides:
isIntersectionType18in classTypeBinding
-
kind
public int kind()- Overrides:
kindin classTypeBinding
-
debugName
- Overrides:
debugNamein classReferenceBinding
-
toString
-
getSAMType
-
upwardsProjection
Description copied from class:TypeBindingPerform an upwards type projection as per JLS 4.10.5- Overrides:
upwardsProjectionin classTypeBinding- Parameters:
scope- Relevant scope for evaluating type projectionmentionedTypeVariables- Filter for mentioned type variables- Returns:
- Upwards type projection of 'this', or null if upwards projection is undefined
-
downwardsProjection
Description copied from class:TypeBindingPerform a downwards type projection as per JLS 4.10.5- Overrides:
downwardsProjectionin classTypeBinding- Parameters:
scope- Relevant scope for evaluating type projectionmentionedTypeVariables- Filter for mentioned type variables- Returns:
- Downwards type projection of 'this', or null if downwards projection is undefined
-
mentionsAny
Description copied from class:TypeBindingDoes this type mention any of the given type parameters, except the one at position 'idx'?- Overrides:
mentionsAnyin classTypeBinding
-
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
-