Package edu.umd.cs.findbugs
Class MethodWarningSuppressor
- java.lang.Object
-
- edu.umd.cs.findbugs.WarningSuppressor
-
- edu.umd.cs.findbugs.ClassWarningSuppressor
-
- edu.umd.cs.findbugs.MethodWarningSuppressor
-
- All Implemented Interfaces:
Matcher
public class MethodWarningSuppressor extends ClassWarningSuppressor
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBUG_TYPEprivate MethodAnnotationmethodprivate booleanuserGeneratedMethodIndicates whether this method was "user generated" as defined inMemberUtils.isUserGenerated(org.apache.bcel.classfile.FieldOrMethod)When a method is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_METHOD-
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 MethodWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, MethodAnnotation method, boolean userGeneratedClass, boolean userGeneratedMethod)
-
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.-
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
-
method
private final MethodAnnotation method
-
userGeneratedMethod
private final boolean userGeneratedMethod
Indicates whether this method was "user generated" as defined inMemberUtils.isUserGenerated(org.apache.bcel.classfile.FieldOrMethod)When a method is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_METHOD
-
-
Constructor Detail
-
MethodWarningSuppressor
public MethodWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, MethodAnnotation method, boolean userGeneratedClass, boolean userGeneratedMethod)
-
-
Method Detail
-
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.
-
-