public class IndexChecker extends UpperBoundChecker
The checkers run in this order:
Constant Value Checker, SameLen Checker, SearchIndex Checker, Lower Bound Checker, Upper Bound Checker
The Constant Value Checker has no dependencies, but it does trust Positive annotations from the Lower Bound Checker. This means that if the Value Checker is run on code containing Positive annotations, then the Lower Bound Checker also needs to be run to guarantee soundness.
The SameLen Checker has no dependencies.
The SearchIndex Checker depends only on the Value Checker, which it uses to refine SearchIndexFor types to NegativeIndexFor types by comparing to compile-time constants of zero or negative one.
The Lower Bound Checker depends only on the Value Checker. It uses the Value Checker to:
a.length - x
, if x is a compile-time
constant, and if the minimum length of a > x, the resulting expression is non-negative.
a.length
), if the minimum length of the array is
≥ 1, then the type is @Positive; if its MinLen is zero, then the type is @NonNegative.
The Upper Bound Checker depends on all three other checkers.
Value dependencies in the UBC:
SameLen dependencies in the UBC:
Lower Bound dependencies in UBC:
currentRoot, DETAILS_SEPARATOR, elementsWithSuppressedWarnings, errsOnLastExit, messager, messages, MSGS_FILE, parentChecker, SUPPRESS_ALL_KEY, trees, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, visitor
processingEnv
Constructor and Description |
---|
IndexChecker() |
getImmediateSubcheckerClasses, shouldSkipUses
createSourceVisitor, getAnnotationProvider, getChecker, getContext, getOptions, getSubchecker, getSupportedLintOptions, getSupportedOptions, getTreePathCacher, getTypeFactory, getTypeFactoryOfSubchecker, getVisitor, initChecker, invokeConstructorFor, printMessage, processArg, setRoot, shouldAddShutdownHook, shouldResolveReflection, shutdownHook, typeProcess, typeProcessingOver, warnUnneededSuppressions
addOptions, createSupportedLintOptions, expandCFOptions, formatStackTrace, fullMessageOf, getBooleanOption, getBooleanOption, getElementUtils, getLintOption, getLintOption, getMessages, getOption, getOption, getOptionConfiguration, getProcessingEnvironment, getProperties, getStandardSuppressWarningsKeys, getSupportedAnnotationTypes, getSupportedSourceVersion, getSuppressWarningsKeys, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, hasOption, init, message, printStats, report, setLintOption, setParentChecker, setProcessingEnvironment, setSupportedLintOptions, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, treeToFilePositionString, typeProcessingStart, useUncheckedCodeDefault, warnUnneedSuppressions
process
getCompletions, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementUtils, getOptionConfiguration, getProcessingEnvironment, getTreeUtils, getTypeUtils