Class UnnecessaryPmdSuppressionRule
java.lang.Object
net.sourceforge.pmd.properties.AbstractPropertySource
net.sourceforge.pmd.lang.rule.AbstractRule
net.sourceforge.pmd.lang.rule.impl.UnnecessaryPmdSuppressionRule
- All Implemented Interfaces:
Rule,PropertySource
A rule that reports unused suppression annotations and comments.
This rule class supports any PMD language, but language-specific behavior
needs to be implemented to avoid false positives for some languages.
Violations of this rule cannot be suppressed. It is special cased
by
RuleSets to execute after all other rules, so that whether
those produce warnings or not is known to this rule.- Experimental Status:
- Since 7.14.0. See [core] Add rule to report unnecessary suppression comments/annotations #5609
-
Field Summary
Fields inherited from interface net.sourceforge.pmd.lang.rule.Rule
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(Node rootNode, RuleContext ctx) Process the given node.Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule
addExample, asCtx, buildTargetSelector, deepCopy, end, equals, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getPriority, getPropertySourceType, getRuleClass, getRuleSetName, getSince, getTargetSelector, hashCode, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, startMethods inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
definePropertyDescriptor, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setPropertyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sourceforge.pmd.properties.PropertySource
definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setPropertyMethods inherited from interface net.sourceforge.pmd.lang.rule.Rule
initialize
-
Constructor Details
-
UnnecessaryPmdSuppressionRule
public UnnecessaryPmdSuppressionRule()
-
-
Method Details
-
apply
Description copied from interface:RuleProcess the given node. The nodes that are fed to this method are the nodes selected byRule.getTargetSelector().- Parameters:
rootNode- Node on which to apply the rulectx- Rule context, handling violations
-