public class InterningAnnotatedTypeFactory extends BaseAnnotatedTypeFactory
AnnotatedTypeFactory that accounts for the properties of the Interned type system.
This type factory will add the Interned annotation to a type if the input:
BaseAnnotatedTypeFactory and inherits its functionality, including:
flow-sensitive qualifier inference, qualifier polymorphism (of PolyInterned), implicit
annotations via ImplicitFor on Interned (to handle cases 1, 2, 4), and
user-specified defaults via DefaultQualifier. Case 5 is handled by the stub library.GenericAnnotatedTypeFactory.ScanStateAnnotatedTypeFactory.InheritedFromClassAnnotator, AnnotatedTypeFactory.ParameterizedExecutableTypeanalysis, cfgVisualizer, defaults, dependentTypesHelper, emptyStore, flowByDefault, flowResult, flowResultAnalysisCaches, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, transfer, treeAnnotator, typeAnnotatorchecker, elements, fromExpressionTreeCache, fromMemberTreeCache, fromTypeTreeCache, ignoreUninferredTypeArguments, loader, objectGetClass, processingEnv, qualHierarchy, reflectionResolver, root, shouldCache, trees, typeArgumentInference, typeFormatter, typeHierarchy, types, typeVarSubstitutor, uid, visitorState| Constructor and Description |
|---|
InterningAnnotatedTypeFactory(BaseTypeChecker checker)
Creates a new
InterningAnnotatedTypeFactory that operates on a particular AST. |
| Modifier and Type | Method and Description |
|---|---|
void |
addComputedTypeAnnotations(Element element,
AnnotatedTypeMirror type)
Changes annotations on a type obtained from an
Element. |
void |
addComputedTypeAnnotations(Tree tree,
AnnotatedTypeMirror type,
boolean useFlow)
Like {#addComputedTypeAnnotations(Tree, AnnotatedTypeMirror)}.
|
protected TreeAnnotator |
createTreeAnnotator()
Returns a
TreeAnnotator that adds annotations to a type based on the contents of a
tree. |
protected TypeAnnotator |
createTypeAnnotator()
Returns a
ImplicitsTypeAnnotator
that adds annotations to a type based on the content of the type itself. |
AnnotatedTypeMirror.AnnotatedPrimitiveType |
getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
Unbox type and replace any interning type annotations with @Interned since all primitives can
safely use ==.
|
createFlowAnalysisaddCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addDefaultAnnotations, addTypeNameImplicit, addUncheckedCodeDefaults, addUncheckedStandardDefaults, analyze, applyInferredAnnotations, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, createAndInitQualifierDefaults, createCFGVisualizer, createDependentTypesHelper, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, fromNewClass, getAnnotatedTypeLhs, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpressionString, getAnnotationFromReceiver, getAnnotationMirrorFromJavaExpressionString, getCFGVisualizer, getDependentTypesHelper, getEmptyStore, getFinalLocalValues, getFirstNodeOfKindForTree, getInferredValueFor, getMethodReturnType, getMethodReturnType, getNodesForTree, getQualifierPolymorphism, getReceiverFromJavaExpressionString, getRegularExitStore, getResultingTypeOfConstructorMemberReference, getReturnStatementStores, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, handleCFGViz, methodFromUse, performFlowAnalysis, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUseadaptGetClassReturnTypeToReceiver, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedDeclAnnotation, addAnnotationFromFieldInvariant, addInheritedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, canonicalAnnotation, checkInvalidOptionsInferSignatures, createAnnotatedTypeFormatter, createAnnotationClassLoader, createAnnotationFormatter, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchyFactory, createSupportedTypeQualifiers, createTypeArgumentInference, createTypeHierarchy, createTypeVariableSubstitutor, declarationFromElement, fromElement, fromElement, fromElement, getAnnotatedNullType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFormatter, getAnnotatedTypeFromTypeTree, getAnnotationFormatter, getAnnotationMirror, getAnnotationWithMetaAnnotation, getBoxedType, getBundledTypeQualifiersWithoutPolyAll, getBundledTypeQualifiersWithPolyAll, getCacheSize, getContext, getCurrentClassTree, getCurrentClassType, getCurrentMethodReceiver, getDeclAnnotation, getDeclAnnotationNoAliases, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getElementUtils, getEnclosingElementForArtificialTree, getEnclosingType, getFieldInvariantAnnotationTree, getFieldInvariantDeclarationAnnotations, getFieldInvariants, getFnInterfaceFromTree, getFnInterfaceFromTree, getImplicitReceiverType, getNarrowedPrimitive, getPath, getProcessingEnv, getQualifierHierarchy, getReceiverType, getSelfType, getStringType, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeHierarchy, getTypeVarSubstitutor, getUninferredWildcardType, getVisitorState, getWholeProgramInference, initializeReflectionResolution, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, methodFromUse, parseStubFiles, postAsMemberOf, postProcessClassTree, postTypeVarSubstitution, setEnclosingElementForArtificialTree, toAnnotatedType, toString, type, widenToUpperBoundpublic InterningAnnotatedTypeFactory(BaseTypeChecker checker)
InterningAnnotatedTypeFactory that operates on a particular AST.checker - the checker to useprotected TreeAnnotator createTreeAnnotator()
GenericAnnotatedTypeFactoryTreeAnnotator 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 subtrees
ImplicitsTreeAnnotator: Adds annotations based on ImplicitFor
meta-annotations
DependentTypesTreeAnnotator: 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));
createTreeAnnotator in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>protected TypeAnnotator createTypeAnnotator()
GenericAnnotatedTypeFactoryImplicitsTypeAnnotator
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.
ImplicitsTypeAnnotator: Adds annotations based on ImplicitFor
meta-annotations.
createTypeAnnotator in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>public void addComputedTypeAnnotations(Tree tree, AnnotatedTypeMirror type, boolean useFlow)
GenericAnnotatedTypeFactoryaddComputedTypeAnnotations in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>public void addComputedTypeAnnotations(Element element, AnnotatedTypeMirror type)
AnnotatedTypeFactoryElement. By default, this method does
nothing. GenericAnnotatedTypeFactory uses this method to implement defaulting.
Subclasses that override this method should also override AnnotatedTypeFactory.addComputedTypeAnnotations(Tree, AnnotatedTypeMirror).
addComputedTypeAnnotations in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>element - an elementtype - the type obtained from eltpublic AnnotatedTypeMirror.AnnotatedPrimitiveType getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
getUnboxedType in class AnnotatedTypeFactorytype - the declared type