Package edu.umd.cs.findbugs
Interface BugCollection
- All Superinterfaces:
Iterable<BugInstance>
- All Known Implementing Classes:
SortedBugCollection
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(BugInstance bugInstance) Add a BugInstance to this BugCollection.booleanadd(BugInstance bugInstance, boolean updateActiveTime) Add a BugInstance to this BugCollection.voidaddAppVersion(AppVersion appVersion) Add an AppVersion representing a version of the analyzed application.voidaddError(AnalysisError error) Add an analysis error.voidAdd an analysis error.voidaddMissingClass(String message) Add a missing class message.Get an Iterator over AppVersions defined in the collection.voidvoidClear all AppVersions representing previously-analyzed versions of the application.voidvoidCreate a new empty BugCollection with the same metadata as this one.longGet the timestamp for when the analysis was performed.getAppVersionFromSequenceNumber(long target) Gets the AppVersion corresponding to the given sequence number.Return the Collection storing the BugInstance objects.Get the current AppVersion.Get the project stats.Get the current release name.longGet the sequence number of the BugCollection.longGet the timestamp for the analyzed code (when it was compiled)booleanReturn whether textual messages will be added to any generated XMLbooleanbooleanbooleaniterator()Return an Iterator over all the BugInstance objects in the BugCollection.lookupFromUniqueId(String uniqueId) Deprecated.voidreadXML(InputStream in) Read XML data from given input stream into this object, populating the Project as a side effect.voidRead XML data from given reader into this object, populating the Project as a side effect.voidRead XML data from given file into this object, populating given Project as a side effect.voidsetAnalysisTimestamp(long timestamp) Set the timestamp for when the analysis was performed.voidsetAnalysisVersion(String analysisVersion) Set the version of FindBugs used to perform the analysisvoidsetApplySuppressions(boolean applySuppressions) voidsetClassFeatureSet(ClassFeatureSet classFeatureSet) voidsetMinimalXML(boolean minimalXML) Set whether we should minimize XMLvoidsetReleaseName(String releaseName) Set the current release name.voidsetSequenceNumber(long sequence) Set the sequence number of the BugCollection.voidsetTimestamp(long timestamp) Get the timestamp for the analyzed code (when it was compiled)voidsetWithMessages(boolean withMessages) Set whether textual messages should be added to any generated XMLorg.dom4j.DocumentConvert the BugCollection into a dom4j Document object.voidwriteEpilogue(XMLOutput xmlOutput) voidwritePrologue(XMLOutput xmlOutput) voidWrite the BugCollection to an XMLOutput object.voidwriteXML(OutputStream out) Write the BugCollection to given output stream as XML using a UTF8 encoding.voidWrite the BugCollection to given output stream as XML.voidWrite this BugCollection to a file as XML.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
ROOT_ELEMENT_NAME
- See Also:
-
SRCMAP_ELEMENT_NAME
- See Also:
-
PROJECT_ELEMENT_NAME
- See Also:
-
ERRORS_ELEMENT_NAME
- See Also:
-
ANALYSIS_ERROR_ELEMENT_NAME
- See Also:
-
ERROR_ELEMENT_NAME
- See Also:
-
ERROR_MESSAGE_ELEMENT_NAME
- See Also:
-
ERROR_EXCEPTION_ELEMENT_NAME
- See Also:
-
ERROR_STACK_TRACE_ELEMENT_NAME
- See Also:
-
MISSING_CLASS_ELEMENT_NAME
- See Also:
-
SUMMARY_HTML_ELEMENT_NAME
- See Also:
-
APP_CLASS_ELEMENT_NAME
- See Also:
-
CLASS_HASHES_ELEMENT_NAME
- See Also:
-
HISTORY_ELEMENT_NAME
- See Also:
-
-
Method Details
-
getProject
Project getProject() -
setReleaseName
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
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
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
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
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
Add a BugInstance to this BugCollection.- Parameters:
bugInstance- the BugInstanceupdateActiveTime- 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.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
Add an analysis error.- Parameters:
message- the error message
-
addError
Add an analysis error.- Parameters:
error- the AnalysisError object to add
-
addMissingClass
Add a missing class message.- Parameters:
message- the missing class message
-
setClassFeatureSet
-
writePrologue
- Throws:
IOException
-
writeEpilogue
- Throws:
IOException
-
clearClassFeatures
void clearClassFeatures() -
clearMissingClasses
void clearMissingClasses() -
readXML
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:
IOExceptionorg.dom4j.DocumentException
-
readXML
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:
IOExceptionorg.dom4j.DocumentException
-
readXML
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:
IOExceptionorg.dom4j.DocumentException
-
writeXML
Write this BugCollection to a file as XML.- Parameters:
fileName- the file to write to- Throws:
IOException
-
writeXML
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
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
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:
iteratorin interfaceIterable<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
-
isApplySuppressions
boolean isApplySuppressions() -
setApplySuppressions
void setApplySuppressions(boolean applySuppressions) -
bugsPopulated
void bugsPopulated()
-