Package edu.umd.cs.findbugs
Class BugPattern
java.lang.Object
edu.umd.cs.findbugs.BugPattern
- All Implemented Interfaces:
Comparable<BugPattern>
A BugPattern object collects all of the metadata for a particular species of
BugInstance. Specifically, it stores the human-readable text for displaying a
bug instance. BugPatterns derive from the BugPattern elements in the
"findbugs.xml" and "messages.xml" found in a FindBugs plugin.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final String
(package private) final int
private boolean
private final String
private final boolean
private final String
(package private) int
(package private) static final BugPattern
private final String
private final String
private final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
adjustPriority
(int change) int
compareTo
(BugPattern other) boolean
Get the BugKindGet the BugCodeGet the BugCategoryint
getCWEid()
Get the detail text as a complete HTML document.getDetailHTML
(String detailText) Get the Plain text describing the bug.Get the HTML detail text describing the bug.Get the long description.int
Get the short description.getType()
Get the BugPatterngetUri()
int
hashCode()
boolean
boolean
Is the bug pattern experimental?(package private) void
setDeprecated
(boolean deprecated) The method is not public to disallow modification of this attributetoString()
wrapInDescriptionLink
(String text)
-
Field Details
-
type
-
abbrev
-
category
-
experimental
private final boolean experimental -
shortDescription
-
longDescription
-
detailText
-
url
-
cweid
final int cweid -
priorityAdjustment
int priorityAdjustment -
deprecated
private boolean deprecated -
REALLY_UNKNOWN
-
-
Constructor Details
-
BugPattern
public BugPattern(String type, String abbrev, String category, boolean experimental, String shortDescription, String longDescription, String detailText, String bugsUrl, int cweid) Constructor.- Parameters:
type
- the type (species) of BugInstanceabbrev
- the abbreviation or "bug code"; seeBugCode
category
- the categoryexperimental
- true if the bug pattern is experimentalshortDescription
- short one-line description of the bug specieslongDescription
- longer one-line description; may contain placeholders for use byFindBugsMessageFormat
to format BugAnnotationsdetailText
- HTML text containing a full description of the bug speciesbugsUrl
- URL of web-page containing bug descriptions or null if there's no such page.cweid
- Common Weakness Enumeration (CWE) ID of the bug pattern
-
-
Method Details
-
getType
Get the BugPattern -
getAbbrev
Get the BugKind -
getBugCode
Get the BugCode -
getCategory
Get the BugCategory -
getPriorityAdjustment
public int getPriorityAdjustment() -
adjustPriority
public void adjustPriority(int change) -
getCategoryAbbrev
-
isExperimental
public boolean isExperimental()Is the bug pattern experimental? -
getShortDescription
Get the short description. -
getLongDescription
Get the long description. -
getDetailText
Get the HTML detail text describing the bug. -
getDetailPlainText
Get the Plain text describing the bug. -
getDetailHTML
Get the detail text as a complete HTML document. -
getDetailHTML
-
wrapInDescriptionLink
-
getUri
-
compareTo
- Specified by:
compareTo
in interfaceComparable<BugPattern>
-
hashCode
public int hashCode() -
equals
-
getCWEid
public int getCWEid()- Returns:
- Returns the cweid.
-
toString
-
setDeprecated
void setDeprecated(boolean deprecated) The method is not public to disallow modification of this attribute- Parameters:
deprecated
- true if this bug pattern is not used anymore and exists for backward compatibility only
-
isDeprecated
public boolean isDeprecated()- Returns:
- true if this bug pattern is not used anymore and exists for backward compatibility only
-