Class PackageWarningSuppressor
java.lang.Object
edu.umd.cs.findbugs.WarningSuppressor
edu.umd.cs.findbugs.PackageWarningSuppressor
- All Implemented Interfaces:
Matcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String(package private) Stringprivate final booleanIndicates 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_PACKAGEFields inherited from class WarningSuppressor
bugPattern, DEBUG, matchType, PRIORITY, USELESS_SUPPRESSION_ABB -
Constructor Summary
ConstructorsConstructorDescriptionPackageWarningSuppressor(String bugPattern, SuppressMatchType matchType, String packageName, boolean userGeneratedPackage) -
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 WarningSuppressor
addAlternateSuppressors, adjustBugPatternForMessage, getAlternateSuppressors, writeXML
-
Field Details
-
BUG_TYPE
- See Also:
-
packageName
String packageName -
userGeneratedPackage
private final boolean userGeneratedPackageIndicates 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 Details
-
PackageWarningSuppressor
public PackageWarningSuppressor(String bugPattern, SuppressMatchType matchType, String packageName, boolean userGeneratedPackage)
-
-
Method Details
-
getPackageName
-
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 classWarningSuppressor- Parameters:
bugInstance- the BugInstance- Returns:
- true if the BugInstance matches, false if not
-
buildUselessSuppressionBugInstance
- Specified by:
buildUselessSuppressionBugInstancein classWarningSuppressor
-
isUselessSuppressionReportable
public boolean isUselessSuppressionReportable()- Overrides:
isUselessSuppressionReportablein classWarningSuppressor- Returns:
- true if useless suppressions should be reported.
-