Class IteratorChecker
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.iterator.IteratorChecker
- All Implemented Interfaces:
Processor,OptionConfiguration
@RelevantJavaTypes(java.util.Collection.class)
@StubFiles("javaparser.astub")
@SuppressWarningsPrefix({"iterator","modifiability"})
public class IteratorChecker
extends ModifiabilityBaseChecker
A type-checker that checks whether a collection's iterator preserves the collection's
modifiability.
The checker enforces the iterator portion of the Modifiability type system, where
@IteratorPolyMod collections have iterators that preserve relevant modifiability
capabilities and @MaybeIteratorPolyMod collections have unknown iterator-preservation
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
-
IteratorChecker
public IteratorChecker()Creates an IteratorChecker.
-
-
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
-