Class MethodWarningSuppressor
java.lang.Object
edu.umd.cs.findbugs.WarningSuppressor
edu.umd.cs.findbugs.ClassWarningSuppressor
edu.umd.cs.findbugs.MethodWarningSuppressor
- All Implemented Interfaces:
Matcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final MethodAnnotationprivate final booleanIndicates 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_METHODFields inherited from class ClassWarningSuppressor
clazzFields inherited from class WarningSuppressor
bugPattern, DEBUG, matchType, PRIORITY, USELESS_SUPPRESSION_ABB -
Constructor Summary
ConstructorsConstructorDescriptionMethodWarningSuppressor(String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, MethodAnnotation method, boolean userGeneratedClass, boolean userGeneratedMethod) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanmatch(BugInstance bugInstance) Determine whether or not the given BugInstance has the feature this Matcher tests for.Methods inherited from class ClassWarningSuppressor
getClassAnnotationMethods inherited from class WarningSuppressor
addAlternateSuppressors, adjustBugPatternForMessage, getAlternateSuppressors, writeXML
-
Field Details
-
BUG_TYPE
- See Also:
-
method
-
userGeneratedMethod
private final boolean userGeneratedMethodIndicates 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 Details
-
MethodWarningSuppressor
public MethodWarningSuppressor(String bugPattern, SuppressMatchType matchType, ClassAnnotation clazz, MethodAnnotation method, boolean userGeneratedClass, boolean userGeneratedMethod)
-
-
Method Details
-
match
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
- Overrides:
buildUselessSuppressionBugInstancein classClassWarningSuppressor
-
isUselessSuppressionReportable
public boolean isUselessSuppressionReportable()- Overrides:
isUselessSuppressionReportablein classClassWarningSuppressor- Returns:
- true if useless suppressions should be reported.
-