FindBugs™ 1.3.4

edu.umd.cs.findbugs
Interface BugCollection

All Known Implementing Classes:
SortedBugCollection

public interface BugCollection


Field Summary
static java.lang.String ANALYSIS_ERROR_ELEMENT_NAME
           
static java.lang.String APP_CLASS_ELEMENT_NAME
           
static java.lang.String CLASS_HASHES_ELEMENT_NAME
           
static java.lang.String ERROR_ELEMENT_NAME
           
static java.lang.String ERROR_EXCEPTION_ELEMENT_NAME
           
static java.lang.String ERROR_MESSAGE_ELEMENT_NAME
           
static java.lang.String ERROR_STACK_TRACE_ELEMENT_NAME
           
static java.lang.String ERRORS_ELEMENT_NAME
           
static java.lang.String HISTORY_ELEMENT_NAME
           
static java.lang.String MISSING_CLASS_ELEMENT_NAME
           
static java.lang.String PROJECT_ELEMENT_NAME
           
static java.lang.String ROOT_ELEMENT_NAME
           
static java.lang.String SRCMAP_ELEMENT_NAME
           
static java.lang.String SUMMARY_HTML_ELEMENT_NAME
           
 
Method Summary
 boolean add(BugInstance bugInstance)
          Add a BugInstance to this BugCollection.
 boolean add(BugInstance bugInstance, boolean updateActiveTime)
          Add a BugInstance to this BugCollection.
 void addAppVersion(AppVersion appVersion)
          Add an AppVersion representing a version of the analyzed application.
 void addError(AnalysisError error)
          Add an analysis error.
 void addError(java.lang.String message)
          Add an analysis error.
 void addMissingClass(java.lang.String message)
          Add a missing class message.
 java.util.Iterator<AppVersion> appVersionIterator()
          Get an Iterator over AppVersions defined in the collection.
 void clearAppVersions()
          Clear all AppVersions representing previously-analyzed versions of the application.
 void clearClassFeatures()
           
 BugCollection createEmptyCollectionWithMetadata()
          Create a new empty BugCollection with the same metadata as this one.
 BugInstance findBug(java.lang.String instanceHash, java.lang.String bugType, int lineNumber)
           
 long getAnalysisTimestamp()
          Get the timestamp for when the analysis was performed.
 AppVersion getAppVersionFromSequenceNumber(long target)
          Gets the AppVersion corresponding to the given sequence number.
 java.util.Collection<BugInstance> getCollection()
          Return the Collection storing the BugInstance objects.
 AppVersion getCurrentAppVersion()
          Get the current AppVersion.
 ProjectStats getProjectStats()
          Get the project stats.
 java.lang.String getReleaseName()
          Get the current release name.
 long getSequenceNumber()
          Get the sequence number of the BugCollection.
 long getTimestamp()
          Get the timestamp for the analyzed code return the timestamp.
 boolean getWithMessages()
          Return whether textual messages will be added to any generated XML
 java.util.Iterator<BugInstance> iterator()
          Return an Iterator over all the BugInstance objects in the BugCollection.
 BugInstance lookupFromUniqueId(java.lang.String uniqueId)
          Deprecated. 
 void readXML(java.io.InputStream in, Project project)
          Read XML data from given input stream into this object, populating the Project as a side effect.
 void readXML(java.lang.String fileName, Project project)
          Read XML data from given file into this object, populating given Project as a side effect.
 void setAnalysisTimestamp(long timestamp)
          Set the timestamp for when the analysis was performed.
 void setAnalysisVersion(java.lang.String analysisVersion)
          Set the version of FindBugs used to perform the analysis
 void setClassFeatureSet(ClassFeatureSet classFeatureSet)
           
 void setReleaseName(java.lang.String releaseName)
          Set the current release name.
 void setSequenceNumber(long sequence)
          Set the sequence number of the BugCollection.
 void setTimestamp(long timestamp)
          Get the timestamp for the analyzed code
 void setWithMessages(boolean withMessages)
          Set whether textual messages should be added to any generated XML
 org.dom4j.Document toDocument(Project project)
          Convert the BugCollection into a dom4j Document object.
 void writeEpilogue(XMLOutput xmlOutput)
           
 void writePrologue(XMLOutput xmlOutput, Project project)
           
 void writeXML(java.io.OutputStream out, Project project)
          Write the BugCollection to given output stream as XML.
 void writeXML(java.lang.String fileName, Project project)
          Write this BugCollection to a file as XML.
 void writeXML(XMLOutput xmlOutput, Project project)
          Write the BugCollection to an XMLOutput object.
 

Field Detail

ROOT_ELEMENT_NAME

static final java.lang.String ROOT_ELEMENT_NAME
See Also:
Constant Field Values

SRCMAP_ELEMENT_NAME

static final java.lang.String SRCMAP_ELEMENT_NAME
See Also:
Constant Field Values

PROJECT_ELEMENT_NAME

static final java.lang.String PROJECT_ELEMENT_NAME
See Also:
Constant Field Values

ERRORS_ELEMENT_NAME

static final java.lang.String ERRORS_ELEMENT_NAME
See Also:
Constant Field Values

ANALYSIS_ERROR_ELEMENT_NAME

static final java.lang.String ANALYSIS_ERROR_ELEMENT_NAME
See Also:
Constant Field Values

ERROR_ELEMENT_NAME

static final java.lang.String ERROR_ELEMENT_NAME
See Also:
Constant Field Values

ERROR_MESSAGE_ELEMENT_NAME

static final java.lang.String ERROR_MESSAGE_ELEMENT_NAME
See Also:
Constant Field Values

ERROR_EXCEPTION_ELEMENT_NAME

static final java.lang.String ERROR_EXCEPTION_ELEMENT_NAME
See Also:
Constant Field Values

ERROR_STACK_TRACE_ELEMENT_NAME

static final java.lang.String ERROR_STACK_TRACE_ELEMENT_NAME
See Also:
Constant Field Values

MISSING_CLASS_ELEMENT_NAME

static final java.lang.String MISSING_CLASS_ELEMENT_NAME
See Also:
Constant Field Values

SUMMARY_HTML_ELEMENT_NAME

static final java.lang.String SUMMARY_HTML_ELEMENT_NAME
See Also:
Constant Field Values

APP_CLASS_ELEMENT_NAME

static final java.lang.String APP_CLASS_ELEMENT_NAME
See Also:
Constant Field Values

CLASS_HASHES_ELEMENT_NAME

static final java.lang.String CLASS_HASHES_ELEMENT_NAME
See Also:
Constant Field Values

HISTORY_ELEMENT_NAME

static final java.lang.String HISTORY_ELEMENT_NAME
See Also:
Constant Field Values
Method Detail

setReleaseName

void setReleaseName(java.lang.String releaseName)
Set the current release name.

Parameters:
releaseName - the current release name

getReleaseName

java.lang.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

Parameters:
timestamp - the timestamp.

getTimestamp

long getTimestamp()
Get the timestamp for the analyzed code return the timestamp.


setAnalysisTimestamp

void setAnalysisTimestamp(long timestamp)
Set the timestamp for when the analysis was performed.

Parameters:
timestamp - the analysis timestamp.

setAnalysisVersion

void setAnalysisVersion(java.lang.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()

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

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

java.util.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(java.lang.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(java.lang.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(java.lang.String message)
Add a missing class message.

Parameters:
message - the missing class message

setClassFeatureSet

void setClassFeatureSet(ClassFeatureSet classFeatureSet)

writePrologue

void writePrologue(XMLOutput xmlOutput,
                   Project project)
                   throws java.io.IOException
Throws:
java.io.IOException

writeEpilogue

void writeEpilogue(XMLOutput xmlOutput)
                   throws java.io.IOException
Throws:
java.io.IOException

clearClassFeatures

void clearClassFeatures()

readXML

void readXML(java.lang.String fileName,
             Project project)
             throws java.io.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
project - the Project
Throws:
java.io.IOException
org.dom4j.DocumentException

readXML

void readXML(java.io.InputStream in,
             Project project)
             throws java.io.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
project - the Project
Throws:
java.io.IOException
org.dom4j.DocumentException

writeXML

void writeXML(java.lang.String fileName,
              Project project)
              throws java.io.IOException
Write this BugCollection to a file as XML.

Parameters:
fileName - the file to write to
project - the Project from which the BugCollection was generated
Throws:
java.io.IOException

writeXML

void writeXML(java.io.OutputStream out,
              Project project)
              throws java.io.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
project - the Project from which the BugCollection was generated
Throws:
java.io.IOException

writeXML

void writeXML(XMLOutput xmlOutput,
              Project project)
              throws java.io.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
project - the Project from which the BugCollection was generated
Throws:
java.io.IOException

iterator

java.util.Iterator<BugInstance> iterator()
Return an Iterator over all the BugInstance objects in the BugCollection.


getCollection

java.util.Collection<BugInstance> getCollection()
Return the Collection storing the BugInstance objects.


toDocument

org.dom4j.Document toDocument(Project project)
Convert the BugCollection into a dom4j Document object.

Parameters:
project - the Project from which the BugCollection was generated
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


getWithMessages

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


findBug

BugInstance findBug(java.lang.String instanceHash,
                    java.lang.String bugType,
                    int lineNumber)

FindBugs™ 1.3.4

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.