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 classThis tree annotator modifies the propagation tree annotator to add propagation rules for the freedom-before-commitment system.protected classThis type annotator adds the correct UnderInitialization annotation to super constructors.protected classTheQualifierHierarchyfor the initialization type system.Nested classes/interfaces inherited from class org.checkerframework.framework.type.GenericAnnotatedTypeFactory
GenericAnnotatedTypeFactory.ScanStateNested classes/interfaces inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
AnnotatedTypeFactory.CapturedTypeVarSubstitutor, AnnotatedTypeFactory.ParameterizedExecutableType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanThe value of the assumeInitialized option.protected final AnnotationMirrorprotected final AnnotationMirrorprotected final AnnotationMirrorNotOnlyInitializedor null.protected final TypeMirrorThe java.lang.Object type.protected final AnnotationMirrorprotected final AnnotationMirrorUnderInitializationor null.protected final ExecutableElementThe UnderInitialization.value field/element.protected final AnnotationMirrorprotected final ExecutableElementThe UnknownInitialization.value field/element.protected final ExecutableElementThe 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, typeAnnotatorFields inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
ajavaTypes, annotatedForValueElement, capturedTypeVarSubstitutor, checker, currentFileAjavaTypes, elements, ensuresQualifierExpressionElement, ensuresQualifierIfExpressionElement, ensuresQualifierIfListTM, ensuresQualifierIfListValueElement, ensuresQualifierIfResultElement, ensuresQualifierIfTM, ensuresQualifierListTM, ensuresQualifierListValueElement, ensuresQualifierTM, fieldInvariantFieldElement, fieldInvariantQualifierElement, fromExpressionTreeCache, fromMemberTreeCache, fromTypeTreeCache, hasQualifierParameterValueElement, ignoreRawTypeArguments, loader, methodValClassNameElement, methodValMethodNameElement, methodValParamsElement, noQualifierParameterValueElement, objectGetClass, processingEnv, qualHierarchy, qualifierUpperBounds, reflectionResolver, requiresQualifierExpressionElement, requiresQualifierListTM, requiresQualifierListValueElement, requiresQualifierTM, shouldCache, stubTypes, trees, typeArgumentInference, typeFormatter, typeHierarchy, typeInformationPresenter, types, typeVarSubstitutor, uid, viewpointAdapter -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new InitializationParentAnnotatedTypeFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanareAllFieldsInitializedOnly(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 QualifierHierarchyReturns theQualifierHierarchyto be used by this checker.protected Set<Class<? extends Annotation>> Returns a mutable set of annotation classes that are supported by a checker.protected TreeAnnotatorReturns aTreeAnnotatorthat adds annotations to a type based on the contents of a tree.protected TypeAnnotatorReturns aDefaultForTypeAnnotatorthat adds annotations to a type based on the content of the type itself.createUnderInitializationAnnotation(Class<?> typeFrame) Creates aUnderInitializationannotation with the given type frame.createUnderInitializationAnnotation(TypeMirror typeFrame) Creates aUnderInitializationannotation with the given type as its type frame argument.createUnknownInitializationAnnotation(Class<?> typeFrame) Creates aUnknownInitializationannotation with a given type frame.createUnknownInitializationAnnotation(TypeMirror typeFrame) Creates anUnknownInitializationannotation 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 ofthisat the location oftree.getTypeFrameFromAnnotation(AnnotationMirror annotation) Returns the type frame (that is, the argument) of a given initialization annotation.protected AnnotationMirrorReturns anUnderInitializationannotation that has the superclass oftypeas 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.booleanisFbcBottom(AnnotationMirror anno) Isannothe bottom annotation?booleanDoesannohave the bottom annotation?booleanisImmutable(TypeMirror type) Returnstrue.booleanIsannotheInitializedannotation?booleanDoesannohave the annotationInitialized?booleanisInitializedForFrame(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.booleanisNotFullyInitializedReceiver(MethodTree methodTree) Returns true if the receiver of a method or constructor might not be fully initialized.booleanIsannotheUnderInitializationannotation (with any type frame)?booleanDoesannohave the annotationUnderInitialization(with any type frame)?booleanIsannotheUnknownInitializationannotation (with any type frame)?booleanDoesannohave the annotationUnknownInitialization(with any type frame)?protected booleanisUnused(VariableTree field, Collection<? extends AnnotationMirror> receiverAnnos) Returns whether the specified field is unused, given the specified annotations on the receiver.methodFromUse(ExpressionTree tree, ExecutableElement methodElt, AnnotatedTypeMirror receiverType, boolean inferTypeArgs) voidpostAsMemberOf(AnnotatedTypeMirror type, AnnotatedTypeMirror owner, Element element) A callback method for the AnnotatedTypeFactory subtypes to customize AnnotatedTypes.asMemberOf().protected voidsetSelfTypeInInitializationCode(Tree tree, AnnotatedTypeMirror.AnnotatedDeclaredType selfType, TreePath path) Side-effects argumentselfTypeto make it @Initialized or @UnderInitialization, depending on whether all fields have been set.booleanReturnsfalse.Methods inherited from class org.checkerframework.framework.type.GenericAnnotatedTypeFactory
addAnnotationsFromDefaultForType, addCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotationsWithoutFlow, 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, getReturnStatementStores, getSharedCFGForTree, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, getTypeFactoryOfSubcheckerOrNull, getUseFlow, handleCFGViz, irrelevantExtraMessage, isComputingAnnotatedTypeMirrorOfLhs, isIgnoredExceptionType, isRelevant, isRelevant, isRelevantImpl, methodFromUse, methodFromUsePreSubstitution, parseJavaExpressionString, performFlowAnalysis, postAnalyze, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUseMethods 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, constructorFromUse, constructorFromUseWithoutTypeArgInference, containsCapturedTypes, containsSameByClass, createAnnotatedTypeFormatter, createAnnotationClassLoader, createAnnotationFormatter, createQualifierUpperBounds, createTypeArgumentInference, createTypeHierarchy, createTypeInformationPresenter, createTypeVariableSubstitutor, createViewpointAdapter, declarationFromElement, doesAnnotatedForApplyToThisChecker, fromElement, fromElement, fromElement, 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, getResultingTypeOfConstructorMemberReference, getRoot, getStringType, getSupportedTypeQualifierNames, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeDeclarationBounds, getTypeHierarchy, getTypeOfExtendsImplements, getTypeVarSubstitutor, getUnboxedType, getVisitorTreePath, getWidenedAnnotations, getWidenedType, getWidenedType, hasExplicitNoQualifierParameterInHierarchy, hasExplicitQualifierParameterInHierarchy, hasQualifierParameterInHierarchy, hasQualifierParameterInHierarchy, initializeAtm, initializeReflectionResolution, isDeterministic, isFromByteCode, isFromStubFile, isSideEffectFree, isSupportedQualifier, isSupportedQualifier, isSupportedQualifier, isWithinConstructor, mergeAnnotationFileAnnosIntoType, methodFromUse, methodFromUse, methodFromUseWithoutTypeArgInference, methodFromUseWithoutTypeArgInference, negateConstant, order, parseAnnotationFiles, postProcessClassTree, replaceAnnotations, replaceAnnotations, setPathForArtificialTree, setVisitorTreePath, toAnnotatedType, toString, type
-
Field Details
-
UNKNOWN_INITIALIZATION
-
INITIALIZED
-
UNDER_INITALIZATION
UnderInitializationor null. -
NOT_ONLY_INITIALIZED
NotOnlyInitializedor 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:AnnotatedTypeFactoryA 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:
postAsMemberOfin 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:AnnotatedTypeFactoryReturns 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 otherElementTypevalues) are automatically considered as supported annotations.To support a different set of annotations than those in the qual subdirectory, or that have other
ElementTypevalues, 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:
The set of qualifiers returned by@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:
createSupportedTypeQualifiersin 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:GenericAnnotatedTypeFactoryReturns 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:
createFlowTransferFunctionin 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:
isImmutablein classAnnotatedTypeFactory- Parameters:
type- type to test- Returns:
- true if the type is immutable
-
createUnderInitializationAnnotation
Creates aUnderInitializationannotation with the given type as its type frame argument.- Parameters:
typeFrame- the type down to which some value has been initialized- Returns:
- an
UnderInitializationannotation with the given argument
-
getSelfType
Description copied from class:AnnotatedTypeFactoryReturns the type ofthisat the location oftree. Returnsnulliftreeis in a location wherethishas 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:
getSelfTypein classAnnotatedTypeFactory- Parameters:
tree- location used to decide the type ofthis- Returns:
- the type of
thisat the location oftree
-
setSelfTypeInInitializationCode
protected void setSelfTypeInInitializationCode(Tree tree, AnnotatedTypeMirror.AnnotatedDeclaredType selfType, TreePath path) Side-effects argumentselfTypeto 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 anUnderInitializationannotation that has the superclass oftypeas type frame.- Parameters:
type- a type- Returns:
- true an
UnderInitializationfor 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
fieldis unused givenreceiverAnnos
-
createUnderInitializationAnnotation
Creates aUnderInitializationannotation with the given type frame.- Parameters:
typeFrame- the type down to which some value has been initialized- Returns:
- an
UnderInitializationannotation 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:GenericAnnotatedTypeFactoryReturns true if the receiver of a method or constructor might not be fully initialized.- Overrides:
isNotFullyInitializedReceiverin 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 aUnknownInitializationannotation with a given type frame.- Parameters:
typeFrame- the type down to which some value has been initialized- Returns:
- an
UnknownInitializationannotation with the given argument
-
createUnknownInitializationAnnotation
Creates anUnknownInitializationannotation with a given type frame.- Parameters:
typeFrame- the type down to which some value has been initialized- Returns:
- an
UnknownInitializationannotation with the given argument
-
isUnderInitialization
IsannotheUnderInitializationannotation (with any type frame)?- Parameters:
anno- the annotation to check- Returns:
- true if
annoisUnderInitialization
-
isUnknownInitialization
IsannotheUnknownInitializationannotation (with any type frame)?- Parameters:
anno- the annotation to check- Returns:
- true if
annoisUnknownInitialization
-
isFbcBottom
Isannothe bottom annotation?- Parameters:
anno- the annotation to check- Returns:
- true if
annoisFBCBottom
-
isInitialized
IsannotheInitializedannotation?- Parameters:
anno- the annotation to check- Returns:
- true if
annoisInitialized
-
isUnderInitialization
Doesannohave the annotationUnderInitialization(with any type frame)?- Parameters:
anno- the annotation to check- Returns:
- true if
annohasUnderInitialization
-
isUnknownInitialization
Doesannohave the annotationUnknownInitialization(with any type frame)?- Parameters:
anno- the annotation to check- Returns:
- true if
annohasUnknownInitialization
-
isFbcBottom
Doesannohave the bottom annotation?- Parameters:
anno- the annotation to check- Returns:
- true if
annohasFBCBottom
-
isInitialized
Doesannohave the annotationInitialized?- Parameters:
anno- the annotation to check- Returns:
- true if
annohasInitialized
-
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- aUnderInitializationorUnknownInitializationannotation- Returns:
- the annotation's argument
-
createQualifierHierarchy
Description copied from class:AnnotatedTypeFactoryReturns theQualifierHierarchyto 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:
createQualifierHierarchyin classAnnotatedTypeFactory- Returns:
- a QualifierHierarchy for this type system
-
createTypeAnnotator
Description copied from class:GenericAnnotatedTypeFactoryReturns aDefaultForTypeAnnotatorthat adds annotations to a type based on the content of the type itself.Subclass may override this method. The default type annotator is a
ListTypeAnnotatorof the following:IrrelevantTypeAnnotator: Adds top to types not listed in the@RelevantJavaTypesannotation on the checker.PropagationTypeAnnotator: Propagates annotation onto wildcards.
- Overrides:
createTypeAnnotatorin 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:
shouldWarnIfStubRedundantWithBytecodein classAnnotatedTypeFactory- Returns:
- whether to warn about redundancy between a stub file and bytecode
-
createTreeAnnotator
Description copied from class:GenericAnnotatedTypeFactoryReturns aTreeAnnotatorthat adds annotations to a type based on the contents of a tree.The default tree annotator is a
ListTreeAnnotatorof the following:PropagationTreeAnnotator: Propagates annotations from subtreesLiteralTreeAnnotator: Adds annotations based onQualifierForLiteralsmeta-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:
createTreeAnnotatorin classGenericAnnotatedTypeFactory<CFValue,InitializationStore, InitializationTransfer, InitializationAnalysis> - Returns:
- a tree annotator
-
methodFromUse
protected AnnotatedTypeFactory.ParameterizedExecutableType methodFromUse(ExpressionTree tree, ExecutableElement methodElt, AnnotatedTypeMirror receiverType, boolean inferTypeArgs) Description copied from class:AnnotatedTypeFactoryThe implementation ofAnnotatedTypeFactory.methodFromUse(ExpressionTree, ExecutableElement, AnnotatedTypeMirror)andAnnotatedTypeFactory.methodFromUseWithoutTypeArgInference(ExpressionTree, ExecutableElement, AnnotatedTypeMirror).- Overrides:
methodFromUsein classAnnotatedTypeFactory- Parameters:
tree- either a MethodInvocationTree or a MemberReferenceTreemethodElt- the element of the referenced methodreceiverType- the type of the receiverinferTypeArgs- whether type arguments should be inferred- Returns:
- the type of the invoked method
-