Class QueryBugAnnotations

java.lang.Object
edu.umd.cs.findbugs.QueryBugAnnotations

public abstract class QueryBugAnnotations extends Object
Search for bug instances whose text annotations contain one of a set of keywords.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addKeyword(String keyword)
    Add a keyword to the query.
    protected abstract void
    match(BugInstance bugInstance, String filename)
    Called when a bug instance contains a query keyword.
    void
    scan(BugCollection bugCollection, String filename)
    Scan bug instances contained in given bug collection, reporting those whose text annotations contain at least one of the keywords in the query.
    void
    scan(String filename)
    Scan bug instances contained in given file, reporting those whose text annotations contain at least one of the keywords in the query.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QueryBugAnnotations

      public QueryBugAnnotations()
  • Method Details

    • addKeyword

      public void addKeyword(String keyword)
      Add a keyword to the query. A BugInstance's text annotation must contain at least one keyword in order to match the query.
      Parameters:
      keyword - the keyword
    • scan

      public void scan(String filename) throws Exception
      Scan bug instances contained in given file, reporting those whose text annotations contain at least one of the keywords in the query.
      Parameters:
      filename - an XML file containing bug instances
      Throws:
      Exception
    • scan

      public void scan(BugCollection bugCollection, String filename) throws Exception
      Scan bug instances contained in given bug collection, reporting those whose text annotations contain at least one of the keywords in the query.
      Parameters:
      bugCollection - the bug collection
      filename - the XML file from which the bug collection was read
      Throws:
      Exception
    • match

      protected abstract void match(BugInstance bugInstance, String filename) throws Exception
      Called when a bug instance contains a query keyword.
      Parameters:
      bugInstance - the bug instance containing the keyword
      filename - name of the file containing the bug instance
      Throws:
      Exception