Class BugPattern

java.lang.Object
edu.umd.cs.findbugs.BugPattern
All Implemented Interfaces:
Comparable<BugPattern>

public class BugPattern extends Object implements 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.
Author:
David Hovemeyer
See Also:
  • 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 BugInstance
      abbrev - the abbreviation or "bug code"; see BugCode
      category - the category
      experimental - true if the bug pattern is experimental
      shortDescription - short one-line description of the bug species
      longDescription - longer one-line description; may contain placeholders for use by FindBugsMessageFormat to format BugAnnotations
      detailText - HTML text containing a full description of the bug species
      bugsUrl - 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

      public String getType()
      Get the BugPattern
    • getAbbrev

      public String getAbbrev()
      Get the BugKind
    • getBugCode

      @Nonnull public BugCode getBugCode()
      Get the BugCode
    • getCategory

      public String getCategory()
      Get the BugCategory
    • getPriorityAdjustment

      public int getPriorityAdjustment()
    • adjustPriority

      public void adjustPriority(int change)
    • getCategoryAbbrev

      public String getCategoryAbbrev()
    • isExperimental

      public boolean isExperimental()
      Is the bug pattern experimental?
    • getShortDescription

      public String getShortDescription()
      Get the short description.
    • getLongDescription

      public String getLongDescription()
      Get the long description.
    • getDetailText

      public String getDetailText()
      Get the HTML detail text describing the bug.
    • getDetailPlainText

      public String getDetailPlainText()
      Get the Plain text describing the bug.
    • getDetailHTML

      public String getDetailHTML()
      Get the detail text as a complete HTML document.
    • getDetailHTML

      public String getDetailHTML(String detailText)
    • wrapInDescriptionLink

      public String wrapInDescriptionLink(String text)
    • getUri

      public Optional<URI> getUri()
    • compareTo

      public int compareTo(BugPattern other)
      Specified by:
      compareTo in interface Comparable<BugPattern>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getCWEid

      public int getCWEid()
      Returns:
      Returns the cweid.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isDeprecated

      public boolean isDeprecated()
      Returns:
      true if this bug pattern is not used anymore and exists for backward compatibility only