public class LowerBoundAnnotatedTypeFactory
extends org.checkerframework.common.basetype.BaseAnnotatedTypeFactory
The type hierarchy is: Top = lbu ("Lower Bound Unknown") | gte-1 ("Greater than or equal to -1") | nn ("NonNegative") | pos ("Positive")In general, check whether the constant Value Checker can determine the value of a variable; if it can, use that; if not, use more specific rules based on expression type. This class implements the following type rules:
--i
when
i
is non-negative implies that i
will be GTEN1 afterwards). Should this be
3 rules?
++i
when
i
is non-negative implies that i
will be positive afterwards). Should this
be 3 rules?
Modifier and Type | Field and Description |
---|---|
javax.lang.model.element.AnnotationMirror |
BOTTOM
The bottom annotation.
|
javax.lang.model.element.AnnotationMirror |
GTEN1
The canonical @
GTENegativeOne annotation. |
javax.lang.model.element.AnnotationMirror |
NN
The canonical @
NonNegative annotation. |
javax.lang.model.element.AnnotationMirror |
POLY
The canonical @
PolyLowerBound annotation. |
javax.lang.model.element.AnnotationMirror |
POS
The canonical @
Positive annotation. |
javax.lang.model.element.AnnotationMirror |
UNKNOWN
The canonical @
LowerBoundUnknown annotation. |
analysis, cfgVisualizer, defaults, dependentTypesHelper, emptyStore, FLOW_BY_DEFAULT, flowResult, flowResultAnalysisCaches, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, transfer, treeAnnotator, typeAnnotator
checker, elements, fromExpressionTreeCache, fromMemberTreeCache, fromTypeTreeCache, ignoreUninferredTypeArguments, loader, processingEnv, qualHierarchy, reflectionResolver, root, shouldCache, trees, typeArgumentInference, typeFormatter, typeHierarchy, types, typeVarSubstitutor, uid, visitorState
Constructor and Description |
---|
LowerBoundAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker) |
Modifier and Type | Method and Description |
---|---|
void |
addComputedTypeAnnotations(javax.lang.model.element.Element element,
org.checkerframework.framework.type.AnnotatedTypeMirror type)
Handles cases 1, 2, and 3.
|
void |
addComputedTypeAnnotations(Tree tree,
org.checkerframework.framework.type.AnnotatedTypeMirror type,
boolean iUseFlow)
Handles cases 1, 2, and 3.
|
protected java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
createSupportedTypeQualifiers() |
org.checkerframework.framework.type.treeannotator.TreeAnnotator |
createTreeAnnotator() |
LessThanAnnotatedTypeFactory |
getLessThanAnnotatedTypeFactory()
Returns the LessThan Checker's annotated type factory.
|
SearchIndexAnnotatedTypeFactory |
getSearchIndexAnnotatedTypeFactory()
Returns the SearchIndexFor Checker's annotated type factory.
|
org.checkerframework.common.value.ValueAnnotatedTypeFactory |
getValueAnnotatedTypeFactory()
Returns the Value Checker's annotated type factory.
|
boolean |
isNonNegative(Tree tree)
Checks if the expression is non-negative, i.e.
|
createFlowAnalysis
addCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addDefaultAnnotations, addTypeNameImplicit, addUncheckedCodeDefaults, addUncheckedStandardDefaults, analyze, analyze, applyInferredAnnotations, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, createAndInitQualifierDefaults, createCFGVisualizer, createDependentTypesHelper, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, createTypeAnnotator, fromNewClass, getAnnotatedTypeLhs, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpressionString, getAnnotationFromReceiver, getCFGVisualizer, getDependentTypesHelper, getEmptyStore, getFinalLocalValues, getFirstNodeOfKindForTree, getInferredValueFor, getMethodReturnType, getMethodReturnType, getNodesForTree, getReceiverFromJavaExpressionString, getRegularExitStore, getResultingTypeOfConstructorMemberReference, getReturnStatementStores, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, handleCFGViz, methodFromUse, performFlowAnalysis, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUse
adaptGetClassReturnTypeToReceiver, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedDeclAnnotation, addAnnotationFromFieldInvariant, addInheritedAnnotation, aliasedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, checkInvalidOptionsInferSignatures, createAnnotatedTypeFormatter, createAnnotationClassLoader, createAnnotationFormatter, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchyFactory, 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, getSelfType, getStringType, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeHierarchy, getTypeVarSubstitutor, getUnboxedType, getUninferredWildcardType, getVisitorState, getWholeProgramInference, initializeReflectionResolution, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, methodFromUse, parseStubFiles, postAsMemberOf, postProcessClassTree, postTypeVarSubstitution, setPathHack, toAnnotatedType, toString, type, widenToUpperBound
public final javax.lang.model.element.AnnotationMirror GTEN1
GTENegativeOne
annotation.public final javax.lang.model.element.AnnotationMirror NN
NonNegative
annotation.public final javax.lang.model.element.AnnotationMirror POS
Positive
annotation.public final javax.lang.model.element.AnnotationMirror BOTTOM
public final javax.lang.model.element.AnnotationMirror UNKNOWN
LowerBoundUnknown
annotation.public final javax.lang.model.element.AnnotationMirror POLY
PolyLowerBound
annotation.public LowerBoundAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker)
protected java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> createSupportedTypeQualifiers()
createSupportedTypeQualifiers
in class org.checkerframework.framework.type.AnnotatedTypeFactory
public void addComputedTypeAnnotations(javax.lang.model.element.Element element, org.checkerframework.framework.type.AnnotatedTypeMirror type)
addComputedTypeAnnotations
in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<org.checkerframework.framework.flow.CFValue,org.checkerframework.framework.flow.CFStore,org.checkerframework.framework.flow.CFTransfer,org.checkerframework.framework.flow.CFAnalysis>
public void addComputedTypeAnnotations(Tree tree, org.checkerframework.framework.type.AnnotatedTypeMirror type, boolean iUseFlow)
addComputedTypeAnnotations
in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<org.checkerframework.framework.flow.CFValue,org.checkerframework.framework.flow.CFStore,org.checkerframework.framework.flow.CFTransfer,org.checkerframework.framework.flow.CFAnalysis>
public org.checkerframework.common.value.ValueAnnotatedTypeFactory getValueAnnotatedTypeFactory()
public SearchIndexAnnotatedTypeFactory getSearchIndexAnnotatedTypeFactory()
public LessThanAnnotatedTypeFactory getLessThanAnnotatedTypeFactory()
public org.checkerframework.framework.type.treeannotator.TreeAnnotator createTreeAnnotator()
createTreeAnnotator
in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<org.checkerframework.framework.flow.CFValue,org.checkerframework.framework.flow.CFStore,org.checkerframework.framework.flow.CFTransfer,org.checkerframework.framework.flow.CFAnalysis>
public boolean isNonNegative(Tree tree)