Package edu.umd.cs.findbugs
Class ClassWarningSuppressor
- java.lang.Object
-
- edu.umd.cs.findbugs.WarningSuppressor
-
- edu.umd.cs.findbugs.ClassWarningSuppressor
-
- All Implemented Interfaces:
Matcher
- Direct Known Subclasses:
FieldWarningSuppressor,MethodWarningSuppressor,ParameterWarningSuppressor
public class ClassWarningSuppressor extends WarningSuppressor
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBUG_TYPE(package private) ClassAnnotationclazzprivate booleanuserGeneratedClassIndicates whether this class was "user generated" as defined inMemberUtils.isUserGenerated(edu.umd.cs.findbugs.ba.XClass)When a class is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_CLASS-
Fields inherited from class edu.umd.cs.findbugs.WarningSuppressor
bugPattern, DEBUG, matchType, PRIORITY, USELESS_SUPPRESSION_ABB
-
-
Constructor Summary
Constructors Constructor Description ClassWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, boolean userGeneratedClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BugInstancebuildUselessSuppressionBugInstance(UselessSuppressionDetector detector)ClassAnnotationgetClassAnnotation()booleanisUselessSuppressionReportable()booleanmatch(BugInstance bugInstance)Determine whether or not the given BugInstance has the feature this Matcher tests for.-
Methods inherited from class edu.umd.cs.findbugs.WarningSuppressor
addAlternateSuppressors, adjustBugPatternForMessage, getAlternateSuppressors, writeXML
-
-
-
-
Field Detail
-
BUG_TYPE
private static final java.lang.String BUG_TYPE
- See Also:
- Constant Field Values
-
clazz
ClassAnnotation clazz
-
userGeneratedClass
private final boolean userGeneratedClass
Indicates whether this class was "user generated" as defined inMemberUtils.isUserGenerated(edu.umd.cs.findbugs.ba.XClass)When a class is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_CLASS
-
-
Constructor Detail
-
ClassWarningSuppressor
public ClassWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, boolean userGeneratedClass)- Parameters:
userGeneratedClass-
-
-
Method Detail
-
getClassAnnotation
public ClassAnnotation getClassAnnotation()
-
buildUselessSuppressionBugInstance
public BugInstance buildUselessSuppressionBugInstance(UselessSuppressionDetector detector)
- Specified by:
buildUselessSuppressionBugInstancein classWarningSuppressor
-
match
public boolean match(BugInstance bugInstance)
Description copied from interface:MatcherDetermine whether or not the given BugInstance has the feature this Matcher tests for.- Specified by:
matchin interfaceMatcher- Overrides:
matchin classWarningSuppressor- Parameters:
bugInstance- the BugInstance- Returns:
- true if the BugInstance matches, false if not
-
isUselessSuppressionReportable
public boolean isUselessSuppressionReportable()
- Overrides:
isUselessSuppressionReportablein classWarningSuppressor- Returns:
- true if useless suppressions should be reported.
-
-