public class NullnessAnnotatedTypeFactory extends InitializationAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
NullnessAnnotatedTypeFactory.NullnessPropagationAnnotator
Nullness doesn't call propagation on binary and unary because the result is
always @Initialized (the default qualifier).
|
protected class |
NullnessAnnotatedTypeFactory.NullnessQualifierHierarchy |
protected class |
NullnessAnnotatedTypeFactory.NullnessTreeAnnotator |
protected class |
NullnessAnnotatedTypeFactory.NullnessTypeAnnotator |
InitializationAnnotatedTypeFactory.CommitmentTreeAnnotator, InitializationAnnotatedTypeFactory.CommitmentTypeAnnotator, InitializationAnnotatedTypeFactory.InitializationQualifierHierarchy| Modifier and Type | Field and Description |
|---|---|
protected CollectionToArrayHeuristics |
collectionToArrayHeuristics |
protected AnnotationMirror |
MONOTONIC_NONNULL
Annotation constants
|
protected AnnotationMirror |
NONNULL
Annotation constants
|
protected AnnotationMirror |
NULLABLE
Annotation constants
|
protected Set<Class<? extends Annotation>> |
nullnessAnnos
Cache for the nullness annotations
|
protected AnnotationMirror |
POLYNULL
Annotation constants
|
protected SystemGetPropertyHandler |
systemGetPropertyHandler |
COMMITTED, FBCBOTTOM, FREE, initAnnos, NOT_ONLY_COMMITTED, UNCLASSIFIED, useFbcanalysis, cfgVisualizer, defaults, dependentTypesHelper, emptyStore, FLOW_BY_DEFAULT, flowResult, flowResultAnalysisCaches, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, transfer, treeAnnotator, typeAnnotatorchecker, elements, fromExpressionTreeCache, fromMemberTreeCache, fromTypeTreeCache, ignoreUninferredTypeArguments, loader, processingEnv, qualHierarchy, reflectionResolver, root, shouldCache, trees, typeArgumentInference, typeFormatter, typeHierarchy, types, typeVarSubstitutor, uid, visitorState| Constructor and Description |
|---|
NullnessAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker,
boolean useFbc) |
| Modifier and Type | Method and Description |
|---|---|
void |
adaptGetClassReturnTypeToReceiver(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedExecutableType getClassType,
org.checkerframework.framework.type.AnnotatedTypeMirror receiverType) |
protected org.checkerframework.framework.type.AnnotatedTypeFormatter |
createAnnotatedTypeFormatter() |
protected NullnessAnalysis |
createFlowAnalysis(List<org.checkerframework.javacutil.Pair<VariableElement,NullnessValue>> fieldValues) |
NullnessTransfer |
createFlowTransferFunction(org.checkerframework.framework.flow.CFAbstractAnalysis<NullnessValue,NullnessStore,NullnessTransfer> analysis) |
org.checkerframework.framework.type.QualifierHierarchy |
createQualifierHierarchy(org.checkerframework.framework.util.MultiGraphQualifierHierarchy.MultiGraphFactory factory) |
protected Set<Class<? extends Annotation>> |
createSupportedTypeQualifiers() |
protected org.checkerframework.framework.type.treeannotator.TreeAnnotator |
createTreeAnnotator() |
protected org.checkerframework.framework.type.typeannotator.TypeAnnotator |
createTypeAnnotator() |
AnnotationMirror |
getFieldInvariantAnnotation()
Returns the annotation that makes up the invariant of this commitment type system, such as
@NonNull. |
Set<Class<? extends Annotation>> |
getInvalidConstructorReturnTypeAnnotations() |
org.checkerframework.framework.type.AnnotatedTypeMirror |
getMethodReturnType(MethodTree m,
ReturnTree r) |
Set<Class<? extends Annotation>> |
getNullnessAnnotations() |
List<VariableTree> |
getUninitializedInvariantFields(NullnessStore store,
TreePath path,
boolean isStatic,
List<? extends AnnotationMirror> receiverAnnotations)
Returns the (non-static) fields that have the invariant annotation and are not yet
initialized in a given store.
|
protected boolean |
hasFieldInvariantAnnotation(org.checkerframework.framework.type.AnnotatedTypeMirror type)
Returns whether or not
type has the invariant annotation. |
org.checkerframework.javacutil.Pair<org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedExecutableType,List<org.checkerframework.framework.type.AnnotatedTypeMirror>> |
methodFromUse(MethodInvocationTree tree) |
protected void |
replacePolyQualifier(org.checkerframework.framework.type.AnnotatedTypeMirror lhsType,
Tree context)
|
areAllFieldsCommittedOnly, createFreeAnnotation, createFreeAnnotation, createQualifierHierarchyFactory, createUnclassifiedAnnotation, createUnclassifiedAnnotation, getAnnotatedTypeLhs, getFreeOrRawAnnotationOfSuperType, getInitializationAnnotations, getInitializedInvariantFields, getSelfType, getTypeFrameFromAnnotation, hasFieldInvariantAnnotation, isCommitted, isCommitted, isFbcBottom, isFbcBottom, isFree, isFree, isInitializationAnnotation, isInitializedForFrame, isUnclassified, isUnclassified, postAsMemberOf, setSelfTypeInInitializationCodeaddCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotations, addDefaultAnnotations, addTypeNameImplicit, addUncheckedCodeDefaults, addUncheckedStandardDefaults, analyze, applyInferredAnnotations, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, createAndInitQualifierDefaults, createCFGVisualizer, createDependentTypesHelper, createQualifierDefaults, createQualifierPolymorphism, fromNewClass, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpressionString, getAnnotationFromReceiver, getAnnotationMirrorFromJavaExpressionString, getCFGVisualizer, getDependentTypesHelper, getEmptyStore, getFinalLocalValues, getFirstNodeOfKindForTree, getInferredValueFor, getMethodReturnType, getNodesForTree, getReceiverFromJavaExpressionString, getRegularExitStore, getResultingTypeOfConstructorMemberReference, getReturnStatementStores, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, handleCFGViz, performFlowAnalysis, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUseaddAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedDeclAnnotation, addAnnotationFromFieldInvariant, addInheritedAnnotation, aliasedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, checkInvalidOptionsInferSignatures, createAnnotationClassLoader, createAnnotationFormatter, createQualifierHierarchy, createQualifierHierarchy, 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, getEnclosingMethod, getEnclosingType, getFieldInvariantAnnotationTree, getFieldInvariantDeclarationAnnotations, getFieldInvariants, getFnInterfaceFromTree, getFnInterfaceFromTree, getImplicitReceiverType, getNarrowedPrimitive, getPath, getProcessingEnv, getQualifierHierarchy, getReceiverType, getStringType, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeHierarchy, getTypeVarSubstitutor, getUnboxedType, getUninferredWildcardType, getVisitorState, getWholeProgramInference, initializeReflectionResolution, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, methodFromUse, parseStubFiles, postProcessClassTree, postTypeVarSubstitution, setPathHack, toAnnotatedType, toString, type, widenToUpperBoundprotected final AnnotationMirror NONNULL
protected final AnnotationMirror NULLABLE
protected final AnnotationMirror POLYNULL
protected final AnnotationMirror MONOTONIC_NONNULL
protected final SystemGetPropertyHandler systemGetPropertyHandler
protected final CollectionToArrayHeuristics collectionToArrayHeuristics
protected final Set<Class<? extends Annotation>> nullnessAnnos
public NullnessAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker,
boolean useFbc)
protected Set<Class<? extends Annotation>> createSupportedTypeQualifiers()
createSupportedTypeQualifiers in class org.checkerframework.framework.type.AnnotatedTypeFactoryprotected void replacePolyQualifier(org.checkerframework.framework.type.AnnotatedTypeMirror lhsType,
Tree context)
PolyNull or PolyAll with Nullable if the org.checkerframework.dataflow analysis has determined
that this is allowed soundly. For example:
@PolyNull String foo(@PolyNull String param) {
if (param == null) {
// @PolyNull is really @Nullable, so change
// the type of param to @Nullable.
param = null;
}
return param;
}
lhsType - type to replace whose polymorphic qualifier will be replacedcontext - tree used to get dataflow valuepublic List<VariableTree> getUninitializedInvariantFields(NullnessStore store, TreePath path, boolean isStatic, List<? extends AnnotationMirror> receiverAnnotations)
InitializationAnnotatedTypeFactoryprotected NullnessAnalysis createFlowAnalysis(List<org.checkerframework.javacutil.Pair<VariableElement,NullnessValue>> fieldValues)
createFlowAnalysis in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>public NullnessTransfer createFlowTransferFunction(org.checkerframework.framework.flow.CFAbstractAnalysis<NullnessValue,NullnessStore,NullnessTransfer> analysis)
createFlowTransferFunction in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>protected org.checkerframework.framework.type.AnnotatedTypeFormatter createAnnotatedTypeFormatter()
createAnnotatedTypeFormatter in class org.checkerframework.framework.type.AnnotatedTypeFactorypublic org.checkerframework.javacutil.Pair<org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedExecutableType,List<org.checkerframework.framework.type.AnnotatedTypeMirror>> methodFromUse(MethodInvocationTree tree)
methodFromUse in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>public void adaptGetClassReturnTypeToReceiver(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedExecutableType getClassType,
org.checkerframework.framework.type.AnnotatedTypeMirror receiverType)
adaptGetClassReturnTypeToReceiver in class org.checkerframework.framework.type.AnnotatedTypeFactorypublic org.checkerframework.framework.type.AnnotatedTypeMirror getMethodReturnType(MethodTree m, ReturnTree r)
getMethodReturnType in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>protected org.checkerframework.framework.type.typeannotator.TypeAnnotator createTypeAnnotator()
protected org.checkerframework.framework.type.treeannotator.TreeAnnotator createTreeAnnotator()
public Set<Class<? extends Annotation>> getNullnessAnnotations()
public Set<Class<? extends Annotation>> getInvalidConstructorReturnTypeAnnotations()
getInvalidConstructorReturnTypeAnnotations in class InitializationAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>public AnnotationMirror getFieldInvariantAnnotation()
InitializationAnnotatedTypeFactory@NonNull.getFieldInvariantAnnotation in class InitializationAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>protected boolean hasFieldInvariantAnnotation(org.checkerframework.framework.type.AnnotatedTypeMirror type)
type 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. See InitializationAnnotatedTypeFactory.hasFieldInvariantAnnotation(VariableTree) for an example.
In other words, is the lower bound @NonNull?
hasFieldInvariantAnnotation in class InitializationAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>type - of field that might have invariant annotationpublic org.checkerframework.framework.type.QualifierHierarchy createQualifierHierarchy(org.checkerframework.framework.util.MultiGraphQualifierHierarchy.MultiGraphFactory factory)
createQualifierHierarchy in class org.checkerframework.framework.type.AnnotatedTypeFactory