Package edu.umd.cs.findbugs
Class PackageWarningSuppressor
- java.lang.Object
-
- edu.umd.cs.findbugs.WarningSuppressor
-
- edu.umd.cs.findbugs.PackageWarningSuppressor
-
- All Implemented Interfaces:
Matcher
public class PackageWarningSuppressor extends WarningSuppressor
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBUG_TYPE(package private) java.lang.StringpackageNameprivate booleanuserGeneratedPackageIndicates whether this package was "user generated" as defined inMemberUtils.isUserGenerated(edu.umd.cs.findbugs.ba.XClass)When a package is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_PACKAGE-
Fields inherited from class edu.umd.cs.findbugs.WarningSuppressor
bugPattern, DEBUG, matchType, PRIORITY, USELESS_SUPPRESSION_ABB
-
-
Constructor Summary
Constructors Constructor Description PackageWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, java.lang.String packageName, boolean userGeneratedPackage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BugInstancebuildUselessSuppressionBugInstance(UselessSuppressionDetector detector)java.lang.StringgetPackageName()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
-
packageName
java.lang.String packageName
-
userGeneratedPackage
private final boolean userGeneratedPackage
Indicates whether this package was "user generated" as defined inMemberUtils.isUserGenerated(edu.umd.cs.findbugs.ba.XClass)When a package is not user generated we are not interested in reporting warnings, in particular we do not want to report US_USELESS_SUPPRESSION_ON_PACKAGE
-
-
Constructor Detail
-
PackageWarningSuppressor
public PackageWarningSuppressor(java.lang.String bugPattern, SuppressMatchType matchType, java.lang.String packageName, boolean userGeneratedPackage)
-
-
Method Detail
-
getPackageName
public java.lang.String getPackageName()
-
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
-
buildUselessSuppressionBugInstance
public BugInstance buildUselessSuppressionBugInstance(UselessSuppressionDetector detector)
- Specified by:
buildUselessSuppressionBugInstancein classWarningSuppressor
-
isUselessSuppressionReportable
public boolean isUselessSuppressionReportable()
- Overrides:
isUselessSuppressionReportablein classWarningSuppressor- Returns:
- true if useless suppressions should be reported.
-
-