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 javax.lang.model.element.AnnotationMirror |
MONOTONIC_NONNULL
Annotation constants
|
protected javax.lang.model.element.AnnotationMirror |
NONNULL
Annotation constants
|
protected javax.lang.model.element.AnnotationMirror |
NULLABLE
Annotation constants
|
protected java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
nullnessAnnos
Cache for the nullness annotations
|
protected javax.lang.model.element.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(java.util.List<org.checkerframework.javacutil.Pair<javax.lang.model.element.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 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
createSupportedTypeQualifiers() |
protected org.checkerframework.framework.type.treeannotator.TreeAnnotator |
createTreeAnnotator() |
protected org.checkerframework.framework.type.typeannotator.TypeAnnotator |
createTypeAnnotator() |
javax.lang.model.element.AnnotationMirror |
getFieldInvariantAnnotation()
Returns the annotation that makes up the invariant of this commitment type system, such as
@NonNull. |
java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getInvalidConstructorReturnTypeAnnotations() |
org.checkerframework.framework.type.AnnotatedTypeMirror |
getMethodReturnType(MethodTree m,
ReturnTree r) |
java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getNullnessAnnotations() |
java.util.List<VariableTree> |
getUninitializedInvariantFields(NullnessStore store,
TreePath path,
boolean isStatic,
java.util.List<? extends javax.lang.model.element.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,java.util.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, analyze, applyInferredAnnotations, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, createAndInitQualifierDefaults, createCFGVisualizer, createDependentTypesHelper, createQualifierDefaults, createQualifierPolymorphism, fromNewClass, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpressionString, getAnnotationFromReceiver, 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 javax.lang.model.element.AnnotationMirror NONNULL
protected final javax.lang.model.element.AnnotationMirror NULLABLE
protected final javax.lang.model.element.AnnotationMirror POLYNULL
protected final javax.lang.model.element.AnnotationMirror MONOTONIC_NONNULL
protected final SystemGetPropertyHandler systemGetPropertyHandler
protected final CollectionToArrayHeuristics collectionToArrayHeuristics
protected final java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> nullnessAnnos
public NullnessAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker,
boolean useFbc)
protected java.util.Set<java.lang.Class<? extends java.lang.annotation.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 java.util.List<VariableTree> getUninitializedInvariantFields(NullnessStore store, TreePath path, boolean isStatic, java.util.List<? extends javax.lang.model.element.AnnotationMirror> receiverAnnotations)
InitializationAnnotatedTypeFactoryprotected NullnessAnalysis createFlowAnalysis(java.util.List<org.checkerframework.javacutil.Pair<javax.lang.model.element.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,java.util.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 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getNullnessAnnotations()
public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getInvalidConstructorReturnTypeAnnotations()
getInvalidConstructorReturnTypeAnnotations in class InitializationAnnotatedTypeFactory<NullnessValue,NullnessStore,NullnessTransfer,NullnessAnalysis>public javax.lang.model.element.AnnotationMirror getFieldInvariantAnnotation()
InitializationAnnotatedTypeFactory@NonNull.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