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:
ltEqLengthOfValueElement, ltLengthOfOffsetElement, ltLengthOfValueElement, ltOMLengthOfValueElement, substringIndexForOffsetElement, substringIndexForValueElement, upperBoundLiteralValueElement
currentRoot, DETAILS_SEPARATOR, elementsWithSuppressedWarnings, errsOnLastExit, javacErrored, messager, messagesProperties, MSGS_FILE, OPTION_SEPARATOR, parentChecker, SUPPRESS_ALL_MESSAGE_KEY, SUPPRESS_ALL_PREFIX, trees, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, useAllcheckersPrefix, visitor
processingEnv
Constructor and Description |
---|
IndexChecker()
Creates the Index Checker.
|
getImmediateSubcheckerClasses, initChecker, shouldSkipUses
createSourceVisitor, createSourceVisitorPublic, getAnnotationProvider, getExtraStubFiles, getOptions, getOptionsNoSubcheckers, getRelatedClassName, getSubchecker, getSubcheckers, getSupportedLintOptions, getSupportedOptions, getSuppressWarningsPrefixesOfSubcheckers, getTreePathCacher, getTypeFactory, getTypeFactoryOfSubchecker, getUltimateParentChecker, getVisitor, hasOptionNoSubcheckers, invokeConstructorFor, printOrStoreMessage, processArg, reportJavacError, setRoot, shouldAddShutdownHook, shouldResolveReflection, shutdownHook, typeProcess, typeProcessingOver, warnUnneededSuppressions
addOptions, createSupportedLintOptions, expandCFOptions, fullMessageOf, getBooleanOption, getBooleanOption, getElementUtils, getLintOption, getLintOption, getMessagesProperties, getOption, getOption, getOptionConfiguration, getParentChecker, getPathToCompilationUnit, getProcessingEnvironment, getProperties, getStandardSuppressWarningsPrefixes, getSupportedAnnotationTypes, getSupportedSourceVersion, getSuppressWarningsPrefixes, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, hasOption, init, message, message, printOrStoreMessage, printStats, report, reportError, reportWarning, setLintOption, setParentChecker, setProcessingEnvironment, setSupportedLintOptions, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, typeProcessingStart, useConservativeDefault, warnUnneededSuppressions
getCompilerLog, process
getCompletions, isInitialized