Package edu.umd.cs.findbugs
Class FieldWarningSuppressor
- java.lang.Object
-
- edu.umd.cs.findbugs.WarningSuppressor
-
- edu.umd.cs.findbugs.ClassWarningSuppressor
-
- edu.umd.cs.findbugs.FieldWarningSuppressor
-
- All Implemented Interfaces:
Matcher
public class FieldWarningSuppressor extends ClassWarningSuppressor
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBUG_TYPE(package private) FieldAnnotationfieldprivate booleanuserGeneratedFieldIndicates whether this field was "user generated" as defined inMemberUtils.isUserGenerated(org.apache.bcel.classfile.FieldOrMethod)When a field is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_FIELD-
Fields inherited from class edu.umd.cs.findbugs.ClassWarningSuppressor
clazz
-
Fields inherited from class edu.umd.cs.findbugs.WarningSuppressor
bugPattern, DEBUG, matchType, PRIORITY, USELESS_SUPPRESSION_ABB
-
-
Constructor Summary
Constructors Constructor Description FieldWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, FieldAnnotation field, boolean userGeneratedClass, boolean userGeneratedField)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BugInstancebuildUselessSuppressionBugInstance(UselessSuppressionDetector detector)booleanisUselessSuppressionReportable()booleanmatch(BugInstance bugInstance)Determine whether or not the given BugInstance has the feature this Matcher tests for.java.lang.StringtoString()-
Methods inherited from class edu.umd.cs.findbugs.ClassWarningSuppressor
getClassAnnotation
-
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
-
field
FieldAnnotation field
-
userGeneratedField
private final boolean userGeneratedField
Indicates whether this field was "user generated" as defined inMemberUtils.isUserGenerated(org.apache.bcel.classfile.FieldOrMethod)When a field is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_FIELD
-
-
Constructor Detail
-
FieldWarningSuppressor
public FieldWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, FieldAnnotation field, boolean userGeneratedClass, boolean userGeneratedField)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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 classClassWarningSuppressor- Parameters:
bugInstance- the BugInstance- Returns:
- true if the BugInstance matches, false if not
-
buildUselessSuppressionBugInstance
public BugInstance buildUselessSuppressionBugInstance(UselessSuppressionDetector detector)
- Overrides:
buildUselessSuppressionBugInstancein classClassWarningSuppressor
-
isUselessSuppressionReportable
public boolean isUselessSuppressionReportable()
- Overrides:
isUselessSuppressionReportablein classClassWarningSuppressor- Returns:
- true if useless suppressions should be reported.
-
-