Interface BugCollection

All Superinterfaces:
Iterable<BugInstance>
All Known Implementing Classes:
SortedBugCollection

public interface BugCollection extends Iterable<BugInstance>
  • Field Details

  • Method Details

    • getProject

      Project getProject()
    • setReleaseName

      void setReleaseName(String releaseName)
      Set the current release name.
      Parameters:
      releaseName - the current release name
    • getReleaseName

      String getReleaseName()
      Get the current release name.
      Returns:
      current release name
    • getProjectStats

      ProjectStats getProjectStats()
      Get the project stats.
    • setTimestamp

      void setTimestamp(long timestamp)
      Get the timestamp for the analyzed code (when it was compiled)
      Parameters:
      timestamp - the timestamp.
    • getTimestamp

      long getTimestamp()
      Get the timestamp for the analyzed code (when it was compiled)
    • setAnalysisTimestamp

      void setAnalysisTimestamp(long timestamp)
      Set the timestamp for when the analysis was performed.
      Parameters:
      timestamp - the analysis timestamp.
    • setAnalysisVersion

      void setAnalysisVersion(String analysisVersion)
      Set the version of FindBugs used to perform the analysis
      Parameters:
      analysisVersion - the analysis version.
    • getAnalysisTimestamp

      long getAnalysisTimestamp()
      Get the timestamp for when the analysis was performed.
    • getAppVersionFromSequenceNumber

      AppVersion getAppVersionFromSequenceNumber(long target)
      Gets the AppVersion corresponding to the given sequence number.
    • setSequenceNumber

      void setSequenceNumber(long sequence)
      Set the sequence number of the BugCollection.
      Parameters:
      sequence - the sequence number
      See Also:
    • getSequenceNumber

      long getSequenceNumber()
      Get the sequence number of the BugCollection. This value represents the number of times the user has analyzed a different version of the application and updated the historical bug collection using the UpdateBugCollection class.
      Returns:
      the sequence number
    • isMultiversion

      boolean isMultiversion()
    • hasDeadBugs

      boolean hasDeadBugs()
    • clearAppVersions

      void clearAppVersions()
      Clear all AppVersions representing previously-analyzed versions of the application.
    • addAppVersion

      void addAppVersion(AppVersion appVersion)
      Add an AppVersion representing a version of the analyzed application.
      Parameters:
      appVersion - the AppVersion
    • getCurrentAppVersion

      AppVersion getCurrentAppVersion()
      Get the current AppVersion.
    • appVersionIterator

      Iterator<AppVersion> appVersionIterator()
      Get an Iterator over AppVersions defined in the collection.
    • add

      boolean add(BugInstance bugInstance)
      Add a BugInstance to this BugCollection. This just calls add(bugInstance, true).
      Parameters:
      bugInstance - the BugInstance
      Returns:
      true if the BugInstance was added, or false if a matching BugInstance was already in the BugCollection
    • add

      boolean add(BugInstance bugInstance, boolean updateActiveTime)
      Add a BugInstance to this BugCollection.
      Parameters:
      bugInstance - the BugInstance
      updateActiveTime - true if the warning's active time should be updated to include the collection's current time
      Returns:
      true if the BugInstance was added, or false if a matching BugInstance was already in the BugCollection
    • lookupFromUniqueId

      @Deprecated BugInstance lookupFromUniqueId(String uniqueId)
      Deprecated.
      Look up a BugInstance by its unique id.
      Parameters:
      uniqueId - the BugInstance's unique id.
      Returns:
      the BugInstance with the given unique id, or null if there is no such BugInstance This is deprecated; uniqueIDs are not persistent.
    • addError

      void addError(String message)
      Add an analysis error.
      Parameters:
      message - the error message
    • addError

      void addError(AnalysisError error)
      Add an analysis error.
      Parameters:
      error - the AnalysisError object to add
    • addMissingClass

      void addMissingClass(String message)
      Add a missing class message.
      Parameters:
      message - the missing class message
    • setClassFeatureSet

      void setClassFeatureSet(ClassFeatureSet classFeatureSet)
    • writePrologue

      void writePrologue(XMLOutput xmlOutput) throws IOException
      Throws:
      IOException
    • writeEpilogue

      void writeEpilogue(XMLOutput xmlOutput) throws IOException
      Throws:
      IOException
    • clearClassFeatures

      void clearClassFeatures()
    • clearMissingClasses

      void clearMissingClasses()
    • readXML

      void readXML(String fileName) throws IOException, org.dom4j.DocumentException
      Read XML data from given file into this object, populating given Project as a side effect.
      Parameters:
      fileName - name of the file to read
      Throws:
      IOException
      org.dom4j.DocumentException
    • readXML

      void readXML(@WillClose InputStream in) throws IOException, org.dom4j.DocumentException
      Read XML data from given input stream into this object, populating the Project as a side effect. An attempt will be made to close the input stream (even if an exception is thrown).
      Parameters:
      in - the InputStream
      Throws:
      IOException
      org.dom4j.DocumentException
    • readXML

      void readXML(@WillClose Reader reader) throws IOException, org.dom4j.DocumentException
      Read XML data from given reader into this object, populating the Project as a side effect. An attempt will be made to close the reader (even if an exception is thrown).
      Parameters:
      reader - the Reader
      Throws:
      IOException
      org.dom4j.DocumentException
    • writeXML

      void writeXML(String fileName) throws IOException
      Write this BugCollection to a file as XML.
      Parameters:
      fileName - the file to write to
      Throws:
      IOException
    • writeXML

      void writeXML(@WillClose Writer out) throws IOException
      Write the BugCollection to given output stream as XML. The output stream will be closed, even if an exception is thrown.
      Parameters:
      out - the OutputStream to write to
      Throws:
      IOException
    • writeXML

      void writeXML(@WillClose OutputStream out) throws IOException
      Write the BugCollection to given output stream as XML using a UTF8 encoding. The output stream will be closed, even if an exception is thrown.
      Parameters:
      out - the OutputStream to write to
      Throws:
      IOException
    • writeXML

      void writeXML(@WillClose XMLOutput xmlOutput) throws IOException
      Write the BugCollection to an XMLOutput object. The finish() method of the XMLOutput object is guaranteed to be called.

      To write the SummaryHTML element, set property findbugs.report.SummaryHTML to "true".

      Parameters:
      xmlOutput - the XMLOutput object
      Throws:
      IOException
    • iterator

      Iterator<BugInstance> iterator()
      Return an Iterator over all the BugInstance objects in the BugCollection.
      Specified by:
      iterator in interface Iterable<BugInstance>
    • getCollection

      Collection<BugInstance> getCollection()
      Return the Collection storing the BugInstance objects.
    • toDocument

      org.dom4j.Document toDocument()
      Convert the BugCollection into a dom4j Document object.
      Returns:
      the Document representing the BugCollection as a dom4j tree
    • createEmptyCollectionWithMetadata

      BugCollection createEmptyCollectionWithMetadata()
      Create a new empty BugCollection with the same metadata as this one.
      Returns:
      a new empty BugCollection with the same metadata as this one
    • setWithMessages

      void setWithMessages(boolean withMessages)
      Set whether textual messages should be added to any generated XML
    • setMinimalXML

      void setMinimalXML(boolean minimalXML)
      Set whether we should minimize XML
    • getWithMessages

      boolean getWithMessages()
      Return whether textual messages will be added to any generated XML
    • findBug

      BugInstance findBug(String instanceHash, String bugType, int lineNumber)
    • isApplySuppressions

      boolean isApplySuppressions()
    • setApplySuppressions

      void setApplySuppressions(boolean applySuppressions)
    • bugsPopulated

      void bugsPopulated()