Class InitializationAnnotatedTypeFactory.InitializationQualifierHierarchy
java.lang.Object
org.checkerframework.framework.type.QualifierHierarchy
org.checkerframework.framework.type.ElementQualifierHierarchy
org.checkerframework.framework.type.MostlyNoElementQualifierHierarchy
org.checkerframework.checker.initialization.InitializationAnnotatedTypeFactory.InitializationQualifierHierarchy
- Direct Known Subclasses:
NullnessAnnotatedTypeFactory.NullnessQualifierHierarchy
- Enclosing class:
- InitializationAnnotatedTypeFactory<Value extends CFAbstractValue<Value>,
Store extends InitializationStore<Value, Store>, Transfer extends InitializationTransfer<Value, Transfer, Store>, Flow extends CFAbstractAnalysis<Value, Store, Transfer>>
protected abstract class InitializationAnnotatedTypeFactory.InitializationQualifierHierarchy
extends MostlyNoElementQualifierHierarchy
The
QualifierHierarchy
for the initialization type system.
Type systems extending the Initialization Checker should call methods isSubtypeInitialization(javax.lang.model.element.AnnotationMirror, org.checkerframework.framework.util.QualifierKind, javax.lang.model.element.AnnotationMirror, org.checkerframework.framework.util.QualifierKind)
and leastUpperBoundInitialization(javax.lang.model.element.AnnotationMirror, org.checkerframework.framework.util.QualifierKind, javax.lang.model.element.AnnotationMirror, org.checkerframework.framework.util.QualifierKind)
for appropriate qualifiers. See
protected subclass NullnessQualifierHierarchy within class NullnessChecker
for an
example.
-
Field Summary
Fields inherited from class org.checkerframework.framework.type.ElementQualifierHierarchy
bottoms, bottomsMap, kindToElementlessQualifier, qualifierKindHierarchy, tops, topsMap
Fields inherited from class org.checkerframework.framework.type.QualifierHierarchy
atypeFactory
-
Constructor Summary
ModifierConstructorDescriptionprotected
Create an InitializationQualifierHierarchy. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable AnnotationMirror
greatestLowerBoundInitialization
(AnnotationMirror anno1, QualifierKind qual1, AnnotationMirror anno2, QualifierKind qual2) Compute the greatest lower bound of two initialization qualifiers.boolean
isSubtypeInitialization
(AnnotationMirror subAnno, QualifierKind subKind, AnnotationMirror superAnno, QualifierKind superKind) Subtype testing for initialization annotations.protected AnnotationMirror
leastUpperBoundInitialization
(AnnotationMirror anno1, QualifierKind qual1, AnnotationMirror anno2, QualifierKind qual2) Compute the least upper bound of two initialization qualifiers.protected TypeMirror
lubTypeFrame
(TypeMirror a, TypeMirror b) Returns the least upper bound of two Java basetypes (without annotations).Methods inherited from class org.checkerframework.framework.type.MostlyNoElementQualifierHierarchy
greatestLowerBoundQualifiers, greatestLowerBoundWithElements, isSubtypeQualifiers, isSubtypeWithElements, leastUpperBoundQualifiers, leastUpperBoundWithElements
Methods inherited from class org.checkerframework.framework.type.ElementQualifierHierarchy
createBottomsMap, createElementlessQualifierMap, createQualifierKindHierarchy, createTopsMap, findAnnotationInHierarchy, findAnnotationInSameHierarchy, getBottomAnnotation, getBottomAnnotations, getPolymorphicAnnotation, getQualifierKind, getQualifierKind, getTopAnnotation, getTopAnnotations, isPolymorphicQualifier, isValid
Methods inherited from class org.checkerframework.framework.type.QualifierHierarchy
assertSameSize, assertSameSize, canHaveEmptyAnnotationSet, getWidth, greatestLowerBoundQualifiersOnly, greatestLowerBoundShallow, greatestLowerBoundsQualifiersOnly, greatestLowerBoundsQualifiersOnly, greatestLowerBoundsShallow, isSubtypeQualifiersOnly, isSubtypeQualifiersOnly, isSubtypeShallow, isSubtypeShallow, isSubtypeShallow, isSubtypeShallow, isTop, leastUpperBoundQualifiersOnly, leastUpperBoundShallow, leastUpperBoundsQualifiersOnly, leastUpperBoundsQualifiersOnly, leastUpperBoundsShallow, numberOfIterationsBeforeWidening, updateMappingToMutableSet, widenedUpperBound
-
Constructor Details
-
InitializationQualifierHierarchy
protected InitializationQualifierHierarchy()Create an InitializationQualifierHierarchy.
-
-
Method Details
-
isSubtypeInitialization
public boolean isSubtypeInitialization(AnnotationMirror subAnno, QualifierKind subKind, AnnotationMirror superAnno, QualifierKind superKind) Subtype testing for initialization annotations. Will return false if either qualifier is not an initialization annotation. Subclasses should override isSubtype and call this method for initialization qualifiers.- Parameters:
subAnno
- subtype annotationsubKind
- subtype kindsuperAnno
- supertype annotationsuperKind
- supertype kind- Returns:
- true if subAnno is a subtype of superAnno in the initialization hierarchy
-
leastUpperBoundInitialization
protected AnnotationMirror leastUpperBoundInitialization(AnnotationMirror anno1, QualifierKind qual1, AnnotationMirror anno2, QualifierKind qual2) Compute the least upper bound of two initialization qualifiers. Returns null if one of the qualifiers is not in the initialization hierarachy. Subclasses should override leastUpperBound and call this method for initialization qualifiers.- Parameters:
anno1
- an initialization qualifierqual1
- a qualifier kindanno2
- an initialization qualifierqual2
- a qualifier kind- Returns:
- the lub of anno1 and anno2
-
lubTypeFrame
Returns the least upper bound of two Java basetypes (without annotations).- Parameters:
a
- the first argumentb
- the second argument- Returns:
- the lub of the two arguments
-
greatestLowerBoundInitialization
protected @Nullable AnnotationMirror greatestLowerBoundInitialization(AnnotationMirror anno1, QualifierKind qual1, AnnotationMirror anno2, QualifierKind qual2) Compute the greatest lower bound of two initialization qualifiers. Returns null if one of the qualifiers is not in the initialization hierarachy. Subclasses should override greatestLowerBound and call this method for initialization qualifiers.- Parameters:
anno1
- an initialization qualifierqual1
- a qualifier kindanno2
- an initialization qualifierqual2
- a qualifier kind- Returns:
- the glb of anno1 and anno2
-