Class InitializationParentAnnotatedTypeFactory
- All Implemented Interfaces:
AnnotationProvider
- Direct Known Subclasses:
InitializationAnnotatedTypeFactory
,InitializationFieldAccessAnnotatedTypeFactory
InitializationFieldAccessAnnotatedTypeFactory
and InitializationAnnotatedTypeFactory
to contain common functionality.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
This tree annotator modifies the propagation tree annotator to add propagation rules for the freedom-before-commitment system.protected class
This type annotator adds the correct UnderInitialization annotation to super constructors.protected class
TheQualifierHierarchy
for the initialization type system.Nested classes/interfaces inherited from class org.checkerframework.framework.type.GenericAnnotatedTypeFactory
GenericAnnotatedTypeFactory.ScanState
Nested classes/interfaces inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
AnnotatedTypeFactory.ParameterizedExecutableType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean
The value of the assumeInitialized option.protected final AnnotationMirror
protected final AnnotationMirror
protected final AnnotationMirror
NotOnlyInitialized
or null.protected final TypeMirror
The java.lang.Object type.protected final AnnotationMirror
protected final AnnotationMirror
UnderInitialization
or null.protected final ExecutableElement
The UnderInitialization.value field/element.protected final AnnotationMirror
protected final ExecutableElement
The UnknownInitialization.value field/element.protected final ExecutableElement
The Unused.when field/element.Fields inherited from class org.checkerframework.framework.type.GenericAnnotatedTypeFactory
analysis, arraysAreRelevant, cfgVisualizer, contractsUtils, defaults, dependentTypesHelper, emptyStore, exceptionalExitStores, flowByDefault, flowResult, flowResultAnalysisCaches, formalParameterPattern, hasOrIsSubchecker, initializationStaticStore, initializationStore, poly, regularExitStores, relevantJavaTypes, returnStatementStores, scannedClasses, shouldClearSubcheckerSharedCFGs, sideEffectsUnrefineAliases, subcheckerSharedCFG, transfer, treeAnnotator, typeAnnotator
Fields inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
ajavaTypes, annotatedForValueElement, checker, currentFileAjavaTypes, elements, ensuresQualifierExpressionElement, ensuresQualifierIfExpressionElement, ensuresQualifierIfListTM, ensuresQualifierIfListValueElement, ensuresQualifierIfResultElement, ensuresQualifierIfTM, ensuresQualifierListTM, ensuresQualifierListValueElement, ensuresQualifierTM, fieldInvariantFieldElement, fieldInvariantQualifierElement, fromExpressionTreeCache, fromMemberTreeCache, fromTypeTreeCache, hasQualifierParameterValueElement, ignoreUninferredTypeArguments, loader, methodValClassNameElement, methodValMethodNameElement, methodValParamsElement, noQualifierParameterValueElement, objectGetClass, processingEnv, qualHierarchy, qualifierUpperBounds, reflectionResolver, requiresQualifierExpressionElement, requiresQualifierListTM, requiresQualifierListValueElement, requiresQualifierTM, root, shouldCache, stubTypes, trees, typeArgumentInference, typeFormatter, typeHierarchy, typeInformationPresenter, types, typeVarSubstitutor, uid, viewpointAdapter
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new InitializationParentAnnotatedTypeFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areAllFieldsInitializedOnly
(ClassTree classTree) Are all fields initialized-only?createFlowTransferFunction
(CFAbstractAnalysis<CFValue, InitializationStore, InitializationTransfer> analysis) Returns the appropriate transfer function that is used for the given org.checkerframework.dataflow analysis.protected QualifierHierarchy
Returns theQualifierHierarchy
to be used by this checker.protected Set
<Class<? extends Annotation>> Returns a mutable set of annotation classes that are supported by a checker.protected TreeAnnotator
Returns aTreeAnnotator
that adds annotations to a type based on the contents of a tree.protected TypeAnnotator
Returns aDefaultForTypeAnnotator
that adds annotations to a type based on the content of the type itself.createUnderInitializationAnnotation
(Class<?> typeFrame) Creates aUnderInitialization
annotation with the given type frame.createUnderInitializationAnnotation
(TypeMirror typeFrame) Creates aUnderInitialization
annotation with the given type as its type frame argument.createUnknownInitializationAnnotation
(Class<?> typeFrame) Creates aUnknownInitialization
annotation with a given type frame.createUnknownInitializationAnnotation
(TypeMirror typeFrame) Creates anUnknownInitialization
annotation with a given type frame.getInitializedFields
(InitializationStore store, TreePath path) Returns the fields that are initialized in the given store.getSelfType
(Tree tree) Returns the type ofthis
at the location oftree
.getTypeFrameFromAnnotation
(AnnotationMirror annotation) Returns the type frame (that is, the argument) of a given initialization annotation.protected AnnotationMirror
Returns anUnderInitialization
annotation that has the superclass oftype
as type frame.getUninitializedFields
(InitializationStore store, TreePath path, boolean isStatic, Collection<? extends AnnotationMirror> receiverAnnotations) Returns the fields that are possibly uninitialized in a given store, without taking into account the target checker.boolean
isFbcBottom
(AnnotationMirror anno) Isanno
the bottom annotation?boolean
Doesanno
have the bottom annotation?boolean
isImmutable
(TypeMirror type) Returnstrue
.boolean
Isanno
theInitialized
annotation?boolean
Doesanno
have the annotationInitialized
?boolean
isInitializedForFrame
(AnnotatedTypeMirror type, TypeMirror frame) Return true if the type is initialized with respect to the given frame -- that is, all of the fields of the frame are initialized.boolean
isNotFullyInitializedReceiver
(MethodTree methodTree) Returns true if the receiver of a method or constructor might not be fully initialized.boolean
Isanno
theUnderInitialization
annotation (with any type frame)?boolean
Doesanno
have the annotationUnderInitialization
(with any type frame)?boolean
Isanno
theUnknownInitialization
annotation (with any type frame)?boolean
Doesanno
have the annotationUnknownInitialization
(with any type frame)?protected boolean
isUnused
(VariableTree field, Collection<? extends AnnotationMirror> receiverAnnos) Returns whether the specified field is unused, given the specified annotations on the receiver.void
postAsMemberOf
(AnnotatedTypeMirror type, AnnotatedTypeMirror owner, Element element) A callback method for the AnnotatedTypeFactory subtypes to customize AnnotatedTypes.asMemberOf().protected void
setSelfTypeInInitializationCode
(Tree tree, AnnotatedTypeMirror.AnnotatedDeclaredType selfType, TreePath path) Side-effects argumentselfType
to make it @Initialized or @UnderInitialization, depending on whether all fields have been set.boolean
Returnsfalse
.Methods inherited from class org.checkerframework.framework.type.GenericAnnotatedTypeFactory
addAnnotationsFromDefaultForType, addCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotations, addDefaultAnnotations, addSharedCFGForTree, addUncheckedStandardDefaults, analyze, annotationsForIrrelevantJavaType, applyInferredAnnotations, applyQualifierParameterDefaults, applyQualifierParameterDefaults, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, constructorFromUsePreSubstitution, createAndInitQualifierDefaults, createCFGVisualizer, createContractsFromMethod, createDefaultForTypeAnnotator, createDefaultForUseTypeAnnotator, createDependentTypesHelper, createFlowAnalysis, createQualifierDefaults, createQualifierPolymorphism, createRequiresOrEnsuresQualifier, getAnnotatedTypeBefore, getAnnotatedTypeLhs, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpression, getAnnotationFromJavaExpressionString, getAnnotationMirrorFromJavaExpressionString, getAnnotationsFromJavaExpression, getCFGVisualizer, getContractExpressions, getContractsFromMethod, getDefaultAnnotations, getDefaultForTypeAnnotator, getDefaultValueAnnotatedType, getDependentTypesHelper, getEmptyStore, getEnsuresQualifierIfResult, getExceptionalExitStore, getExplicitNewClassAnnos, getExplicitNewClassClassTypeArgs, getExpressionAndOffsetFromJavaExpressionString, getFinalLocalValues, getFirstNodeOfKindForTree, getInferredValueFor, getMethodReturnType, getNodesForTree, getQualifierPolymorphism, getRegularExitStore, getResultingTypeOfConstructorMemberReference, getReturnStatementStores, getSharedCFGForTree, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, getTypeFactoryOfSubcheckerOrNull, handleCFGViz, irrelevantExtraMessage, isComputingAnnotatedTypeMirrorOfLhs, isIgnoredExceptionType, isRelevant, isRelevant, isRelevantImpl, methodFromUse, methodFromUsePreSubstitution, parseJavaExpressionString, performFlowAnalysis, postAnalyze, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUse
Methods inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
adaptGetClassReturnTypeToReceiver, addAliasedDeclAnnotation, addAliasedDeclAnnotation, addAliasedTypeAnnotation, addAliasedTypeAnnotation, addAliasedTypeAnnotation, addAliasedTypeAnnotation, addAnnotationFromFieldInvariant, addInheritedAnnotation, applyCaptureConversion, applyCaptureConversion, applyUnboxing, areSameByClass, binaryTreeArgTypes, binaryTreeArgTypes, canonicalAnnotation, compoundAssignmentTreeArgTypes, containsSameByClass, containsUninferredTypeArguments, createAnnotatedTypeFormatter, createAnnotationClassLoader, createAnnotationFormatter, createQualifierUpperBounds, createTypeArgumentInference, createTypeHierarchy, createTypeInformationPresenter, createTypeVariableSubstitutor, createViewpointAdapter, declarationFromElement, doesAnnotatedForApplyToThisChecker, fromElement, fromElement, fromElement, fromNewClass, getAnnotatedNullType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFormatter, getAnnotatedTypeFromTypeTree, getAnnotationByClass, getAnnotationFormatter, getAnnotationMirror, getAnnotationOrTypeDeclarationBound, getAnnotationWithMetaAnnotation, getBoxedType, getBundledTypeQualifiers, getCacheSize, getChecker, getCheckerNames, getContractExpressions, getContractListValues, getDeclAnnotation, getDeclAnnotationNoAliases, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getDefaultTypeDeclarationBounds, getDummyAssignedTo, getElementUtils, getEnclosingClassOrMethod, getEnclosingSubType, getEnclosingType, getEnumConstructorQualifiers, getExpressionAndOffset, getFieldInvariantAnnotationTree, getFieldInvariantDeclarationAnnotations, getFieldInvariants, getFnInterfaceFromTree, getFunctionTypeFromTree, getFunctionTypeFromTree, getImplicitReceiverType, getIterableElementType, getIterableElementType, getMethodReturnType, getNarrowedAnnotations, getNarrowedPrimitive, getPath, getProcessingEnv, getQualifierHierarchy, getQualifierParameterHierarchies, getQualifierParameterHierarchies, getQualifierUpperBounds, getReceiverType, getStringType, getSupportedTypeQualifierNames, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeDeclarationBounds, getTypeHierarchy, getTypeOfExtendsImplements, getTypeVarSubstitutor, getUnboxedType, getUninferredWildcardType, getVisitorTreePath, getWidenedAnnotations, getWidenedType, getWidenedType, hasExplicitNoQualifierParameterInHierarchy, hasExplicitQualifierParameterInHierarchy, hasQualifierParameterInHierarchy, hasQualifierParameterInHierarchy, initializeReflectionResolution, isDeterministic, isFromByteCode, isFromStubFile, isSideEffectFree, isSupportedQualifier, isSupportedQualifier, isSupportedQualifier, isWithinConstructor, mergeAnnotationFileAnnosIntoType, methodFromUse, negateConstant, order, parseAnnotationFiles, postProcessClassTree, replaceAnnotations, replaceAnnotations, setPathForArtificialTree, setVisitorTreePath, toAnnotatedType, toString, type
-
Field Details
-
UNKNOWN_INITIALIZATION
-
INITIALIZED
-
UNDER_INITALIZATION
UnderInitialization
or null. -
NOT_ONLY_INITIALIZED
NotOnlyInitialized
or null. -
POLY_INITIALIZED
-
FBCBOTTOM
-
objectTypeMirror
The java.lang.Object type. -
unusedWhenElement
The Unused.when field/element. -
underInitializationValueElement
The UnderInitialization.value field/element. -
unknownInitializationValueElement
The UnknownInitialization.value field/element. -
assumeInitialized
protected final boolean assumeInitializedThe value of the assumeInitialized option.
-
-
Constructor Details
-
InitializationParentAnnotatedTypeFactory
Create a new InitializationParentAnnotatedTypeFactory.Don't forget to call
GenericAnnotatedTypeFactory.postInit()
in the concrete subclass.- Parameters:
checker
- the checker to which the new type factory belongs
-
-
Method Details
-
postAsMemberOf
Description copied from class:AnnotatedTypeFactory
A callback method for the AnnotatedTypeFactory subtypes to customize AnnotatedTypes.asMemberOf(). Overriding methods should merely change the annotations on the subtypes, without changing the types.- Overrides:
postAsMemberOf
in classGenericAnnotatedTypeFactory<CFValue,
InitializationStore, InitializationTransfer, InitializationAnalysis> - Parameters:
type
- the annotated type of the elementowner
- the annotated type of the receiver of the accessing treeelement
- the element of the field or method
-
createSupportedTypeQualifiers
Description copied from class:AnnotatedTypeFactory
Returns a mutable set of annotation classes that are supported by a checker.Subclasses may override this method to return a mutable set of their supported type qualifiers through one of the 5 approaches shown below.
Subclasses should not call this method; they should call
AnnotatedTypeFactory.getSupportedTypeQualifiers()
instead.By default, a checker supports all annotations located in a subdirectory called qual that's located in the same directory as the checker. Note that only annotations defined with the
@Target({ElementType.TYPE_USE})
meta-annotation (and optionally with the additional value ofElementType.TYPE_PARAMETER
, but no otherElementType
values) are automatically considered as supported annotations.To support a different set of annotations than those in the qual subdirectory, or that have other
ElementType
values, see examples below.In total, there are 5 ways to indicate annotations that are supported by a checker:
- Only support annotations located in a checker's qual directory:
This is the default behavior. Simply place those annotations within the qual directory.
- Support annotations located in a checker's qual directory and a list of
other annotations:
Place those annotations within the qual directory, and override
AnnotatedTypeFactory.createSupportedTypeQualifiers()
by callingAnnotatedTypeFactory.getBundledTypeQualifiers(Class...)
with a varargs parameter list of the other annotations. Code example:@Override protected Set<Class<? extends Annotation>> createSupportedTypeQualifiers() { return getBundledTypeQualifiers(Regex.class, PartialRegex.class, RegexBottom.class, UnknownRegex.class); }
- Supporting only annotations that are explicitly listed: Override
AnnotatedTypeFactory.createSupportedTypeQualifiers()
and return a mutable set of the supported annotations. Code example:@Override protected Set<Class<? extends Annotation>> createSupportedTypeQualifiers() { return new HashSet<Class<? extends Annotation>>( Arrays.asList(A.class, B.class)); }
AnnotatedTypeFactory.createSupportedTypeQualifiers()
must be a fresh, mutable set. The methodsAnnotatedTypeFactory.getBundledTypeQualifiers(Class...)
must return a fresh, mutable set
- Overrides:
createSupportedTypeQualifiers
in classAnnotatedTypeFactory
- Returns:
- the type qualifiers supported this processor, or an empty set if none
- Only support annotations located in a checker's qual directory:
-
createFlowTransferFunction
public InitializationTransfer createFlowTransferFunction(CFAbstractAnalysis<CFValue, InitializationStore, InitializationTransfer> analysis) Description copied from class:GenericAnnotatedTypeFactory
Returns the appropriate transfer function that is used for the given org.checkerframework.dataflow analysis.This implementation uses the checker naming convention to create the appropriate transfer function. If no transfer function is found, it returns an instance of
CFTransfer
.Subclasses have to override this method to create the appropriate transfer function if they do not follow the checker naming convention.
- Overrides:
createFlowTransferFunction
in classGenericAnnotatedTypeFactory<CFValue,
InitializationStore, InitializationTransfer, InitializationAnalysis> - Parameters:
analysis
- a dataflow analysis- Returns:
- a new transfer function
-
isImmutable
Returnstrue
. Initialization cannot be undone, i.e., an @Initialized object always stays @Initialized, an @UnderInitialization(A) object always stays @UnderInitialization(A) (though it may additionally become @Initialized), etc.- Overrides:
isImmutable
in classAnnotatedTypeFactory
- Parameters:
type
- type to test- Returns:
- true if the type is immutable
-
createUnderInitializationAnnotation
Creates aUnderInitialization
annotation with the given type as its type frame argument.- Parameters:
typeFrame
- the type down to which some value has been initialized- Returns:
- an
UnderInitialization
annotation with the given argument
-
getSelfType
Description copied from class:AnnotatedTypeFactory
Returns the type ofthis
at the location oftree
. Returnsnull
iftree
is in a location wherethis
has no meaning, such as the body of a static method.The parameter is an arbitrary tree and does not have to mention "this", neither explicitly nor implicitly. This method can be overridden for type-system specific behavior.
- Overrides:
getSelfType
in classAnnotatedTypeFactory
- Parameters:
tree
- location used to decide the type ofthis
- Returns:
- the type of
this
at the location oftree
-
setSelfTypeInInitializationCode
protected void setSelfTypeInInitializationCode(Tree tree, AnnotatedTypeMirror.AnnotatedDeclaredType selfType, TreePath path) Side-effects argumentselfType
to make it @Initialized or @UnderInitialization, depending on whether all fields have been set.- Parameters:
tree
- a treeselfType
- the type to side-effectpath
- a path
-
getUnderInitializationAnnotationOfSuperType
Returns anUnderInitialization
annotation that has the superclass oftype
as type frame.- Parameters:
type
- a type- Returns:
- true an
UnderInitialization
for the supertype oftype
-
isUnused
protected boolean isUnused(VariableTree field, Collection<? extends AnnotationMirror> receiverAnnos) Returns whether the specified field is unused, given the specified annotations on the receiver.- Parameters:
field
- the field to checkreceiverAnnos
- the annotations on the receiver- Returns:
- whether
field
is unused givenreceiverAnnos
-
createUnderInitializationAnnotation
Creates aUnderInitialization
annotation with the given type frame.- Parameters:
typeFrame
- the type down to which some value has been initialized- Returns:
- an
UnderInitialization
annotation with the given argument
-
areAllFieldsInitializedOnly
Are all fields initialized-only?- Parameters:
classTree
- the class to query- Returns:
- true if all fields are initialized-only
-
getUninitializedFields
public List<VariableTree> getUninitializedFields(InitializationStore store, TreePath path, boolean isStatic, Collection<? extends AnnotationMirror> receiverAnnotations) Returns the fields that are possibly uninitialized in a given store, without taking into account the target checker.I.e., this method returns all fields that have not been assigned, without considering fields that may be considered initialized by the target checker even though they have not been explicitly assigned. See
InitializationAnnotatedTypeFactory.getUninitializedFields(InitializationStore, CFAbstractStore, TreePath, boolean, Collection)
for a method that does take the target checker into account.- Parameters:
store
- a storepath
- the current path, used to determine the current classisStatic
- whether to report static fields or instance fieldsreceiverAnnotations
- the annotations on the receiver- Returns:
- the fields that are not yet initialized in a given store
-
getInitializedFields
Returns the fields that are initialized in the given store.- Parameters:
store
- a storepath
- the current path; used to compute the current class- Returns:
- the fields that are initialized in the given store
-
isNotFullyInitializedReceiver
Description copied from class:GenericAnnotatedTypeFactory
Returns true if the receiver of a method or constructor might not be fully initialized.- Overrides:
isNotFullyInitializedReceiver
in classGenericAnnotatedTypeFactory<CFValue,
InitializationStore, InitializationTransfer, InitializationAnalysis> - Parameters:
methodTree
- the declaration of the method or constructor- Returns:
- true if the receiver of a method or constructor might not be fully initialized
-
createUnknownInitializationAnnotation
Creates aUnknownInitialization
annotation with a given type frame.- Parameters:
typeFrame
- the type down to which some value has been initialized- Returns:
- an
UnknownInitialization
annotation with the given argument
-
createUnknownInitializationAnnotation
Creates anUnknownInitialization
annotation with a given type frame.- Parameters:
typeFrame
- the type down to which some value has been initialized- Returns:
- an
UnknownInitialization
annotation with the given argument
-
isUnderInitialization
Isanno
theUnderInitialization
annotation (with any type frame)?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
isUnderInitialization
-
isUnknownInitialization
Isanno
theUnknownInitialization
annotation (with any type frame)?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
isUnknownInitialization
-
isFbcBottom
Isanno
the bottom annotation?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
isFBCBottom
-
isInitialized
Isanno
theInitialized
annotation?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
isInitialized
-
isUnderInitialization
Doesanno
have the annotationUnderInitialization
(with any type frame)?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
hasUnderInitialization
-
isUnknownInitialization
Doesanno
have the annotationUnknownInitialization
(with any type frame)?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
hasUnknownInitialization
-
isFbcBottom
Doesanno
have the bottom annotation?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
hasFBCBottom
-
isInitialized
Doesanno
have the annotationInitialized
?- Parameters:
anno
- the annotation to check- Returns:
- true if
anno
hasInitialized
-
isInitializedForFrame
Return true if the type is initialized with respect to the given frame -- that is, all of the fields of the frame are initialized.- Parameters:
type
- the type whose initialization type qualifiers to checkframe
- a class intype
's class hierarchy- Returns:
- true if the type is initialized for the given frame
-
getTypeFrameFromAnnotation
Returns the type frame (that is, the argument) of a given initialization annotation.- Parameters:
annotation
- aUnderInitialization
orUnknownInitialization
annotation- Returns:
- the annotation's argument
-
createQualifierHierarchy
Description copied from class:AnnotatedTypeFactory
Returns theQualifierHierarchy
to be used by this checker.The implementation builds the type qualifier hierarchy for the
AnnotatedTypeFactory.getSupportedTypeQualifiers()
using the meta-annotations found in them. The current implementation returns an instance ofNoElementQualifierHierarchy
.Subclasses must override this method if their qualifiers have elements; the method must return an implementation of
QualifierHierarchy
, such asElementQualifierHierarchy
.- Overrides:
createQualifierHierarchy
in classAnnotatedTypeFactory
- Returns:
- a QualifierHierarchy for this type system
-
createTypeAnnotator
Description copied from class:GenericAnnotatedTypeFactory
Returns aDefaultForTypeAnnotator
that adds annotations to a type based on the content of the type itself.Subclass may override this method. The default type annotator is a
ListTypeAnnotator
of the following:IrrelevantTypeAnnotator
: Adds top to types not listed in the@
RelevantJavaTypes
annotation on the checker.PropagationTypeAnnotator
: Propagates annotation onto wildcards.
- Overrides:
createTypeAnnotator
in classGenericAnnotatedTypeFactory<CFValue,
InitializationStore, InitializationTransfer, InitializationAnalysis> - Returns:
- a type annotator
-
shouldWarnIfStubRedundantWithBytecode
public boolean shouldWarnIfStubRedundantWithBytecode()Returnsfalse
. Redundancy in only the initialization hierarchy is ok and may even be caused by implicit default annotations. The parent checker should determine whether to warn about redundancy.- Overrides:
shouldWarnIfStubRedundantWithBytecode
in classAnnotatedTypeFactory
- Returns:
- whether to warn about redundancy between a stub file and bytecode
-
createTreeAnnotator
Description copied from class:GenericAnnotatedTypeFactory
Returns aTreeAnnotator
that adds annotations to a type based on the contents of a tree.The default tree annotator is a
ListTreeAnnotator
of the following:PropagationTreeAnnotator
: Propagates annotations from subtreesLiteralTreeAnnotator
: Adds annotations based onQualifierForLiterals
meta-annotationsDependentTypesTreeAnnotator
: Adapts dependent annotations based on context
Subclasses may override this method to specify additional tree annotators, for example:
new ListTreeAnnotator(super.createTreeAnnotator(), new KeyLookupTreeAnnotator(this));
- Overrides:
createTreeAnnotator
in classGenericAnnotatedTypeFactory<CFValue,
InitializationStore, InitializationTransfer, InitializationAnalysis> - Returns:
- a tree annotator
-