Class ElementSuppressionChecker
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.checkerframework.javacutil.AbstractTypeProcessor
org.checkerframework.framework.source.SourceChecker
org.checkerframework.common.basetype.BaseTypeChecker
org.checkerframework.framework.testchecker.elementsuppression.ElementSuppressionChecker
- All Implemented Interfaces:
Processor,OptionConfiguration
- Direct Known Subclasses:
ErrorCountChecker
A test checker for suppression of diagnostics reported on elements.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.framework.source.SourceChecker
SourceChecker.CheckerMessage -
Field Summary
Fields inherited from class org.checkerframework.framework.source.SourceChecker
currentRoot, DETAILS_SEPARATOR, elements, messager, MSGS_FILE, OPTION_SEPARATOR, parentChecker, SUPPRESS_ALL_MESSAGE_KEY, SUPPRESS_ALL_PREFIX, trees, types, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, useAllcheckersPrefix, visitorFields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldSuppressWarnings(Element elt, String errKey) Also suppresses every diagnostic within a declaration whose name starts with "SuppressedByOverride", to test that an override of this overload applies to a diagnostic reported on a tree, too.Methods inherited from class org.checkerframework.common.basetype.BaseTypeChecker
createSourceVisitor, createSourceVisitorPublic, getAnnotationProvider, getTypeFactory, getTypeFactoryOfSubcheckerOrNull, getUltimateParentChecker, getVisitor, invokeConstructorFor, isElementAnnotatedForThisCheckerOrUpstreamChecker, processErrorMessageArg, shouldAddShutdownHook, shutdownHookMethods inherited from class org.checkerframework.framework.source.SourceChecker
addOptionsForMode, createMessagesProperties, createRelevantJavaTypes, createSupportedLintOptions, createSupportedModes, expandCFOptions, expandCFOptions, fullMessageOf, getAssumeAssertions, getBooleanOption, getBooleanOption, getClassHierarchy, getElementUtils, getErrorCount, getExtraStubFiles, getImmediateSubcheckerClasses, getLintOption, getLintOption, getOption, getOption, getOptionConfiguration, getOptions, getOptionsNoSubcheckers, getParentChecker, getPathToCompilationUnit, getProcessingEnvironment, getProperties, getRelatedClassName, getRelevantJavaTypes, getStandardSuppressWarningsPrefixes, getStringsOption, getStringsOption, getStubFiles, getSubchecker, getSubCheckerIndex, getSubcheckers, getSupportedAnnotationTypes, getSupportedLintOptions, getSupportedModes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsPrefixes, getSuppressWarningsPrefixesOfSubcheckers, getTreePathCacher, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, getWarningMessagePrefix, handleProcessingError, hasOption, hasOptionNoSubcheckers, init, initChecker, instantiateSubcheckers, message, message, messageKeyMatches, packageProcess, printStats, printStoredMessages, report, reportError, reportWarning, setDiagnosticSink, setHostOptions, setLintOption, setParentChecker, setRoot, shouldResolveReflection, shouldSkipDefs, shouldSkipDefs, shouldSkipDefs, shouldSkipDefs, shouldSkipFiles, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, suppressWarningsString, typeProcess, typeProcessingOver, typeProcessingStart, useConservativeDefault, usePermissiveDefault, warnUnneededSuppressions, warnUnneededSuppressionsMethods inherited from class org.checkerframework.javacutil.AbstractTypeProcessor
getCompilerLog, isExternallyDriven, packageProcessExternally, process, setExternallyDriven, typeProcessExternally, typeProcessingOverExternallyMethods 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
-
ElementSuppressionChecker
public ElementSuppressionChecker()
-
-
Method Details
-
shouldSuppressWarnings
Also suppresses every diagnostic within a declaration whose name starts with "SuppressedByOverride", to test that an override of this overload applies to a diagnostic reported on a tree, too.- Overrides:
shouldSuppressWarningsin classSourceChecker- Parameters:
elt- the Element that might be a source of, or related to, a warningerrKey- the error key the checker is emitting- Returns:
- true if no warning should be emitted for the given Element, either because it is
contained by a declaration with an appropriately-valued
@SuppressWarningsannotation, because it is suppressed by command-line arguments, or because it is outside anAnnotatedForscope when source-based unchecked defaults are enabled; false otherwise
-