Class SubtypingChecker
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- org.checkerframework.javacutil.AbstractTypeProcessor
-
- org.checkerframework.framework.source.SourceChecker
-
- org.checkerframework.common.basetype.BaseTypeChecker
-
- org.checkerframework.common.subtyping.SubtypingChecker
-
- All Implemented Interfaces:
javax.annotation.processing.Processor
,OptionConfiguration
@SupportedOptions({"quals","qualDirs"}) public final class SubtypingChecker extends BaseTypeChecker
A checker for type qualifier systems that only checks subtyping relationships.The annotation(s) are specified on the command line, using an annotation processor argument:
-Aquals
: specifies the annotations in the qualifier hierarchy (as a comma-separated list of fully-qualified annotation names with no spaces in between). Only the annotations for one qualified subtype hierarchy can be passed.
- See the Checker Framework Manual:
- Subtying Checker
-
-
Field Summary
-
Fields inherited from class org.checkerframework.framework.source.SourceChecker
currentRoot, DETAILS_SEPARATOR, elements, elementsWithSuppressedWarnings, errsOnLastExit, javacErrored, messager, messagesProperties, MSGS_FILE, OPTION_SEPARATOR, parentChecker, SUPPRESS_ALL_MESSAGE_KEY, SUPPRESS_ALL_PREFIX, treePathCacher, trees, types, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, useAllcheckersPrefix, visitor
-
-
Constructor Summary
Constructors Constructor Description SubtypingChecker()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.NavigableSet<java.lang.String>
getSuppressWarningsPrefixes()
Returns a modifiable set of lower-case strings that are prefixes for SuppressWarnings strings.static java.util.NavigableSet<java.lang.String>
getSuppressWarningsPrefixes(SourceVisitor<?,?> visitor, java.util.NavigableSet<java.lang.String> superSupportedTypeQualifiers)
Compute SuppressWarnings prefixes, based on the names of all the qualifiers.-
Methods inherited from class org.checkerframework.common.basetype.BaseTypeChecker
createSourceVisitor, createSourceVisitorPublic, getAnnotationProvider, getExtraStubFiles, getImmediateSubcheckerClasses, getOptions, getOptionsNoSubcheckers, getRelatedClassName, getSubchecker, getSubcheckers, getSupportedLintOptions, getSupportedOptions, getSuppressWarningsPrefixesOfSubcheckers, getTypeFactory, getTypeFactoryOfSubcheckerOrNull, getUltimateParentChecker, getVisitor, hasOptionNoSubcheckers, initChecker, invokeConstructorFor, printOrStoreMessage, processErrorMessageArg, setRoot, shouldAddShutdownHook, shouldResolveReflection, shutdownHook, typeProcess, typeProcessingOver, warnUnneededSuppressions
-
Methods inherited from class org.checkerframework.framework.source.SourceChecker
addOptions, createSupportedLintOptions, expandCFOptions, fullMessageOf, getBooleanOption, getBooleanOption, getElementUtils, getLintOption, getLintOption, getMessagesProperties, getOption, getOption, getOptionConfiguration, getParentChecker, getPathToCompilationUnit, getProcessingEnvironment, getProperties, getStandardSuppressWarningsPrefixes, getStringsOption, getStringsOption, getSupportedAnnotationTypes, getSupportedSourceVersion, getTreePathCacher, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, getWarningMessagePrefix, hasOption, init, message, message, messageKeyMatches, printOrStoreMessage, printStats, report, reportError, reportWarning, setLintOption, setParentChecker, setProcessingEnvironment, setSupportedLintOptions, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, shouldSuppressWarnings, typeProcessingStart, useConservativeDefault, warnUnneededSuppressions
-
Methods inherited from class org.checkerframework.javacutil.AbstractTypeProcessor
getCompilerLog, process
-
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.checkerframework.framework.util.OptionConfiguration
getStringsOption, getStringsOption
-
-
-
-
Method Detail
-
getSuppressWarningsPrefixes
public static java.util.NavigableSet<java.lang.String> getSuppressWarningsPrefixes(SourceVisitor<?,?> visitor, java.util.NavigableSet<java.lang.String> superSupportedTypeQualifiers)
Compute SuppressWarnings prefixes, based on the names of all the qualifiers.Provided for the convenience of checkers that do not subclass
SubtypingChecker
(because it is final). Clients should call it like:SubtypingChecker.getSuppressWarningsPrefixes(this.visitor, super.getSuppressWarningsPrefixes());
- Parameters:
visitor
- the visitorsuperSupportedTypeQualifiers
- the result of super.getSuppressWarningsPrefixes(), as executed by checker- Returns:
- SuppressWarnings prefixes, based on the names of all the qualifiers
-
getSuppressWarningsPrefixes
public java.util.NavigableSet<java.lang.String> getSuppressWarningsPrefixes()
Description copied from class:SourceChecker
Returns a modifiable set of lower-case strings that are prefixes for SuppressWarnings strings.The collection must not be empty and must not contain only
SourceChecker.SUPPRESS_ALL_PREFIX
.- Overrides:
getSuppressWarningsPrefixes
in classSourceChecker
- Returns:
- non-empty modifiable set of lower-case prefixes for SuppressWarnings strings
-
-