Class InitializationAnnotatedTypeFactory<Value extends CFAbstractValue<Value>,Store extends InitializationStore<Value,Store>,Transfer extends InitializationTransfer<Value,Transfer,Store>,Flow extends CFAbstractAnalysis<Value,Store,Transfer>>
- All Implemented Interfaces:
AnnotationProvider
- Direct Known Subclasses:
NullnessAnnotatedTypeFactory
NullnessChecker
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
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.CapturedTypeVarSubstitutor, AnnotatedTypeFactory.ParameterizedExecutableType
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AnnotationMirror
String representation of all initialization annotations.protected final Set<Class<? extends Annotation>>
Cache for the initialization annotations.protected final AnnotationMirror
protected final AnnotationMirror
NotOnlyInitialized
or null.protected final TypeMirror
The java.lang.Object type.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, methodInvocationStores, poly, regularExitStores, relevantJavaTypes, returnStatementStores, scannedClasses, shouldClearSubcheckerSharedCFGs, sideEffectsUnrefineAliases, subcheckerSharedCFG, transfer, treeAnnotator, typeAnnotator
Fields inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
ajavaTypes, annotatedForValueElement, artificialTreeToEnclosingElementMap, 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, root, shouldCache, stubTypes, trees, typeArgumentInference, typeFormatter, typeHierarchy, types, typeVarSubstitutor, uid, wpiOutputFormat
-
Constructor Summary
ModifierConstructorDescriptionprotected
Create a new InitializationAnnotatedTypeFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areAllFieldsInitializedOnly
(ClassTree classTree) Are all fields initialized-only?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.getAnnotatedTypeLhs
(Tree lhsTree) Returns the type of a left-hand side of an assignment.abstract AnnotationMirror
Returns the annotation that makes up the invariant of this commitment type system, such as@NonNull
.Set<Class<? extends Annotation>>
getInitializedInvariantFields
(Store store, TreePath path) Returns the fields that have the invariant annotation and are initialized in a given store.Set<Class<? extends Annotation>>
Returns the list of annotations that is forbidden for the constructor return type.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.org.plumelib.util.IPair<List<VariableTree>,
List<VariableTree>> getUninitializedFields
(Store store, TreePath path, boolean isStatic, Collection<? extends AnnotationMirror> receiverAnnotations) Returns the fields that are not yet initialized in a given store.final List<VariableTree>
getUninitializedInvariantFields
(Store store, TreePath path, boolean isStatic, List<? extends AnnotationMirror> receiverAnnotations) Returns the fields that have the invariant annotation and are not yet initialized in a given store.protected final boolean
Returns whether or notfield
has the invariant annotation.protected abstract boolean
hasFieldInvariantAnnotation
(AnnotatedTypeMirror type, VariableElement fieldElement) Returns whether or nottype
has the invariant annotation.boolean
isFbcBottom
(AnnotationMirror anno) Isanno
the bottom annotation?boolean
Doesanno
have the bottom annotation?protected boolean
Is the annotationanno
an initialization qualifier?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
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)?methodFromUse
(ExpressionTree tree, ExecutableElement methodElt, AnnotatedTypeMirror receiverType, boolean inferTypeArgs) 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.Methods inherited from class org.checkerframework.framework.type.GenericAnnotatedTypeFactory
addAnnotationsFromDefaultForType, addCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotationsForWarnRedundant, addDefaultAnnotations, addSharedCFGForTree, addUncheckedStandardDefaults, analyze, annotationsForIrrelevantJavaType, applyInferredAnnotations, applyQualifierParameterDefaults, applyQualifierParameterDefaults, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, constructorFromUsePreSubstitution, createAndInitQualifierDefaults, createCFGVisualizer, createContractsFromMethod, createDefaultForTypeAnnotator, createDefaultForUseTypeAnnotator, createDependentTypesHelper, createFlowAnalysis, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, createRequiresOrEnsuresQualifier, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpression, getAnnotationFromJavaExpressionString, getAnnotationMirrorFromJavaExpressionString, getAnnotationsFromJavaExpression, getCFGVisualizer, getContractAnnotations, getContractAnnotations, getContractExpressions, getContractsFromMethod, getDefaultAnnotations, getDefaultAnnotationsForWarnRedundant, getDefaultForTypeAnnotator, getDefaultValueAnnotatedType, getDependentTypesHelper, getEmptyStore, getEnsuresQualifierIfResult, getExceptionalExitStore, getExplicitNewClassAnnos, getExplicitNewClassClassTypeArgs, getExpressionAndOffsetFromJavaExpressionString, getFinalLocalValues, getFirstNodeOfKindForTree, getInferredValueFor, getMethodReturnType, getNodesForTree, getPostconditionAnnotations, getPostconditionAnnotations, getPostconditionAnnotations, getPreconditionAnnotations, getPreconditionAnnotations, getPreconditionAnnotations, getPreOrPostconditionAnnotations, getQualifierPolymorphism, getRegularExitStore, getReturnStatementStores, getSharedCFGForTree, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, getTypeFactoryOfSubcheckerOrNull, handleCFGViz, irrelevantExtraMessage, isIgnoredExceptionType, isRelevant, isRelevant, isRelevantImpl, isUnreachable, methodFromUse, methodFromUsePreSubstitution, parseJavaExpressionString, performFlowAnalysis, postAnalyze, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUse
Methods inherited from class org.checkerframework.framework.type.AnnotatedTypeFactory
adaptGetClassReturnTypeToReceiver, addAliasedDeclAnnotation, addAliasedTypeAnnotation, addAliasedTypeAnnotation, addAliasedTypeAnnotation, addAliasedTypeAnnotation, addAnnotationFromFieldInvariant, addInheritedAnnotation, applyCaptureConversion, applyCaptureConversion, applyUnboxing, areSameByClass, binaryTreeArgTypes, binaryTreeArgTypes, canonicalAnnotation, checkInvalidOptionsInferSignatures, compoundAssignmentTreeArgTypes, constructorFromUse, constructorFromUseWithoutTypeArgInference, containsCapturedTypes, containsSameByClass, createAnnotatedTypeFormatter, createAnnotationClassLoader, createAnnotationFormatter, createQualifierHierarchy, createQualifierUpperBounds, createSupportedTypeQualifiers, createTypeArgumentInference, createTypeHierarchy, createTypeVariableSubstitutor, declarationFromElement, doesAnnotatedForApplyToThisChecker, fromElement, fromElement, fromElement, getAnnotatedNullType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFormatter, getAnnotatedTypeFromTypeTree, getAnnotationByClass, getAnnotationFormatter, getAnnotationMirror, getAnnotationWithMetaAnnotation, getBoxedType, getBundledTypeQualifiers, getCacheSize, getChecker, getCheckerNames, getContractExpressions, getContractListValues, getDeclAnnotation, getDeclAnnotationNoAliases, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getDefaultTypeDeclarationBounds, getDummyAssignedTo, getElementUtils, getEnclosingClassOrMethod, getEnclosingElementForArtificialTree, getEnclosingSubType, getEnclosingType, getEnumConstructorQualifiers, getExpressionAndOffset, getFieldInvariantAnnotationTree, getFieldInvariantDeclarationAnnotations, getFieldInvariants, getFnInterfaceFromTree, getFunctionTypeFromTree, getFunctionTypeFromTree, getImplicitReceiverType, getIterableElementType, getIterableElementType, getMethodReturnType, getNarrowedAnnotations, getNarrowedPrimitive, getPath, getProcessingEnv, getQualifierHierarchy, getQualifierParameterHierarchies, getQualifierParameterHierarchies, getQualifierUpperBounds, getReceiverType, getResultingTypeOfConstructorMemberReference, getStringType, getSupportedTypeQualifierNames, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeDeclarationBounds, getTypeHierarchy, getTypeOfExtendsImplements, getTypeVarSubstitutor, getUnboxedType, getVisitorTreePath, getWholeProgramInference, getWidenedAnnotations, getWidenedType, getWidenedType, hasExplicitNoQualifierParameterInHierarchy, hasExplicitQualifierParameterInHierarchy, hasQualifierParameterInHierarchy, hasQualifierParameterInHierarchy, initializeAtm, initializeReflectionResolution, isDeterministic, isFromByteCode, isFromStubFile, isImmutable, isSideEffectFree, isSupportedQualifier, isSupportedQualifier, isSupportedQualifier, isTop, isWithinConstructor, logGat, makeConditionConsistentWithOtherMethod, mergeAnnotationFileAnnosIntoType, methodFromUse, methodFromUse, methodFromUseWithoutTypeArgInference, methodFromUseWithoutTypeArgInference, negateConstant, order, parseAnnotationFiles, postProcessClassTree, replaceAnnotations, replaceAnnotations, setEnclosingElementForArtificialTree, setVisitorTreePath, shouldWarnIfStubRedundantWithBytecode, toAnnotatedType, toString, type, wpiAdjustForUpdateField, wpiAdjustForUpdateNonField, wpiPrepareMethodForWriting, wpiPrepareMethodForWriting, wpiShouldInferTypesForReceivers
-
Field Details
-
UNKNOWN_INITIALIZATION
-
INITIALIZED
-
UNDER_INITALIZATION
UnderInitialization
or null. -
NOT_ONLY_INITIALIZED
NotOnlyInitialized
or null. -
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. -
initAnnos
Cache for the initialization annotations. -
initAnnoNames
String representation of all initialization annotations.UnknownInitialization
UnderInitialization
Initialized
FBCBottom
This is used to quickly check of an AnnotationMirror is one of the initialization annotations without having to repeatedly convert them to strings.
-
-
Constructor Details
-
InitializationAnnotatedTypeFactory
Create a new InitializationAnnotatedTypeFactory.- Parameters:
checker
- the checker to which the new type factory belongs
-
-
Method Details
-
getInitializationAnnotations
-
isInitializationAnnotation
Is the annotationanno
an initialization qualifier?- Parameters:
anno
- the annotation to check- Returns:
- true if the argument is an initialization qualifier
-
getInvalidConstructorReturnTypeAnnotations
Returns the list of annotations that is forbidden for the constructor return type.- Returns:
- the list of annotations that is forbidden for the constructor return type
-
getFieldInvariantAnnotation
Returns the annotation that makes up the invariant of this commitment type system, such as@NonNull
.- Returns:
- the invariant annotation for this type system
-
hasFieldInvariantAnnotation
Returns whether or notfield
has the invariant annotation.This method is a convenience method for
hasFieldInvariantAnnotation(AnnotatedTypeMirror, VariableElement)
.If the
field
is a type variable, this method returns true if any possible instantiation of the type parameter could have the invariant annotation. SeehasFieldInvariantAnnotation(VariableTree)
for an example.- Parameters:
field
- field that might have invariant annotation- Returns:
- whether or not field has the invariant annotation
-
hasFieldInvariantAnnotation
protected abstract boolean hasFieldInvariantAnnotation(AnnotatedTypeMirror type, VariableElement fieldElement) Returns whether or nottype
has the invariant annotation.If the
type
is a type variable, this method returns true if any possible instantiation of the type parameter could have the invariant annotation. SeehasFieldInvariantAnnotation(VariableTree)
for an example.- Parameters:
type
- of field that might have invariant annotationfieldElement
- the field element, which can be used to check annotations on the declaration- Returns:
- whether or not the type has the invariant annotation
-
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
-
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
-
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
-
getTypeFrameFromAnnotation
Returns the type frame (that is, the argument) of a given initialization annotation.- Parameters:
annotation
- aUnderInitialization
orUnknownInitialization
annotation- Returns:
- the annotation's 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
-
areAllFieldsInitializedOnly
Are all fields initialized-only?- Parameters:
classTree
- the class to query- Returns:
- true if all fields are initialized-only
-
postAsMemberOf
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.In most cases, subclasses want to call this method first because it may clear all annotations and use the hierarchy's root annotations.
- Overrides:
postAsMemberOf
in classGenericAnnotatedTypeFactory<Value extends CFAbstractValue<Value>,
Store extends InitializationStore<Value, Store>, Transfer extends InitializationTransfer<Value, Transfer, Store>, Flow extends CFAbstractAnalysis<Value, Store, Transfer>> - 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
-
getAnnotatedTypeLhs
Description copied from class:GenericAnnotatedTypeFactory
Returns the type of a left-hand side of an assignment.The default implementation returns the type without considering dataflow type refinement. Subclass can override this method and add additional logic for computing the type of a LHS.
- Overrides:
getAnnotatedTypeLhs
in classGenericAnnotatedTypeFactory<Value extends CFAbstractValue<Value>,
Store extends InitializationStore<Value, Store>, Transfer extends InitializationTransfer<Value, Transfer, Store>, Flow extends CFAbstractAnalysis<Value, Store, Transfer>> - Parameters:
lhsTree
- left-hand side of an assignment- Returns:
- AnnotatedTypeMirror of
lhsTree
-
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
-
getUninitializedFields
public org.plumelib.util.IPair<List<VariableTree>,List<VariableTree>> getUninitializedFields(Store store, TreePath path, boolean isStatic, Collection<? extends AnnotationMirror> receiverAnnotations) Returns the fields that are not yet initialized in a given store. The result is a pair of lists:- fields that are not yet initialized and have the invariant annotation
- fields that are not yet initialized and do not have the invariant annotation
- 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 (a pair of lists)
-
getUninitializedInvariantFields
public final List<VariableTree> getUninitializedInvariantFields(Store store, TreePath path, boolean isStatic, List<? extends AnnotationMirror> receiverAnnotations) Returns the fields that have the invariant annotation and are not yet initialized in a given store.- 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 have the invariant annotation and are not yet initialized in a given store (a pair of lists)
-
getInitializedInvariantFields
Returns the fields that have the invariant annotation and are initialized in a given store.- Parameters:
store
- a storepath
- the current path; used to compute the current class- Returns:
- the fields that have the invariant annotation and are initialized in a given store
-
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
-
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<Value extends CFAbstractValue<Value>,
Store extends InitializationStore<Value, Store>, Transfer extends InitializationTransfer<Value, Transfer, Store>, Flow extends CFAbstractAnalysis<Value, Store, Transfer>> - Returns:
- a type annotator
-
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<Value extends CFAbstractValue<Value>,
Store extends InitializationStore<Value, Store>, Transfer extends InitializationTransfer<Value, Transfer, Store>, Flow extends CFAbstractAnalysis<Value, Store, Transfer>> - Returns:
- a tree annotator
-
methodFromUse
protected AnnotatedTypeFactory.ParameterizedExecutableType methodFromUse(ExpressionTree tree, ExecutableElement methodElt, AnnotatedTypeMirror receiverType, boolean inferTypeArgs) Description copied from class:AnnotatedTypeFactory
The implementation ofAnnotatedTypeFactory.methodFromUse(ExpressionTree, ExecutableElement, AnnotatedTypeMirror)
andAnnotatedTypeFactory.methodFromUseWithoutTypeArgInference(ExpressionTree, ExecutableElement, AnnotatedTypeMirror)
.- Overrides:
methodFromUse
in 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
-