Class SeqGrowChecker
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.checkerframework.javacutil.AbstractTypeProcessor
org.checkerframework.framework.source.SourceChecker
org.checkerframework.common.basetype.BaseTypeChecker
org.checkerframework.checker.modifiability.ModifiabilityBaseChecker
org.checkerframework.checker.modifiability.seqgrow.SeqGrowChecker
- All Implemented Interfaces:
Processor,OptionConfiguration
@RelevantJavaTypes({java.util.Collection.class,java.util.Iterator.class,java.util.Map.class,java.util.Map.Entry.class})
@SuppressWarningsPrefix({"seqgrowable","modifiability"})
public class SeqGrowChecker
extends ModifiabilityBaseChecker
A type-checker that warns, at compile time, if a program might throw
UnsupportedOperationException at run time due to calling a sequenced-grow method on a
collection.
The checker enforces the Modifiability type system, where @SeqGrowable collections can
be safely added to at the front or back, @SeqUngrowable collections cannot, and
@MaybeSeqGrowable collections have unknown sequenced-grow behavior.
- See the Checker Framework Manual:
- Modifiability Checker
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.framework.source.SourceChecker
SourceChecker.CheckerMessage -
Field Summary
Fields inherited from class org.checkerframework.common.basetype.BaseTypeChecker
baseTypeCheckerClassArray, ultimateParentCheckerFields inherited from class org.checkerframework.framework.source.SourceChecker
activeOptions, currentRoot, DETAILS_SEPARATOR, elements, elementsWithSuppressedWarnings, immediateSubcheckers, javacErrored, messager, messagesProperties, messageStore, MSGS_FILE, OPTION_SEPARATOR, parentChecker, subcheckers, supportedOptions, SUPPRESS_ALL_PREFIX, suppressWarningsPrefixesOfSubcheckers, treePathCacher, trees, types, upstreamCheckerNames, useAllcheckersPrefix, visitorFields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanReturns true if this checker refines the result ofiterator()andlistIterator(), and therefore needs to read the Iterator Checker's qualifiers.Methods inherited from class org.checkerframework.checker.modifiability.ModifiabilityBaseChecker
getExtraStubFiles, getImmediateSubcheckerClassesMethods inherited from class org.checkerframework.common.basetype.BaseTypeChecker
createSourceVisitor, createSourceVisitorPublic, createSupportedLintOptions, getAnnotationProvider, getTypeFactory, getTypeFactoryOfSubcheckerOrNull, getUltimateParentChecker, getVisitor, invokeConstructorFor, processErrorMessageArg, shouldAddShutdownHook, shutdownHookMethods inherited from class org.checkerframework.framework.source.SourceChecker
expandCFOptions, fullMessageOf, getBooleanOption, getBooleanOption, getElementUtils, getLintOption, getLintOption, getMessagesProperties, getOption, getOption, getOptionConfiguration, getOptions, getOptionsNoSubcheckers, getParentChecker, getPathToCompilationUnit, getProcessingEnvironment, getProperties, getRelatedClassName, getStandardSuppressWarningsPrefixes, getStringsOption, getStringsOption, getSubchecker, getSubCheckerIndex, getSubcheckers, getSupportedAnnotationTypes, getSupportedLintOptions, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsPrefixes, getSuppressWarningsPrefixesOfSubcheckers, getTreePathCacher, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, hasOption, hasOptionNoSubcheckers, init, initChecker, instantiateSubcheckers, message, message, messageKeyMatches, printOrStoreMessage, printOrStoreMessage, printStats, printStoredMessages, report, reportError, reportOnce, reportWarning, setLintOption, setParentChecker, setRoot, shouldResolveReflection, shouldSkipDefs, shouldSkipDefs, shouldSkipDefs, shouldSkipFiles, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, shouldSuppressWarnings, typeProcess, typeProcessingOver, typeProcessingStart, useConservativeDefault, warnUnneededSuppressions, warnUnneededSuppressionsMethods inherited from class org.checkerframework.javacutil.AbstractTypeProcessor
getCompilerLog, processMethods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.framework.util.OptionConfiguration
getStringsOption, getStringsOption
-
Constructor Details
-
SeqGrowChecker
public SeqGrowChecker()Creates a SeqGrowChecker.
-
-
Method Details
-
usesIteratorChecker
protected boolean usesIteratorChecker()Description copied from class:ModifiabilityBaseCheckerReturns true if this checker refines the result ofiterator()andlistIterator(), and therefore needs to read the Iterator Checker's qualifiers. The Iterator Checker itself does not (it would be its own subchecker), and neither does the SeqGrow Checker, because an iterator has no sequenced-grow methods.- Overrides:
usesIteratorCheckerin classModifiabilityBaseChecker- Returns:
- true if this checker needs the Iterator Checker as a subchecker
-