public class SortedBugCollection extends java.lang.Object implements BugCollection
BugCollection that keeps the BugInstances sorted
by class (using the native comparison ordering of BugInstance's compareTo()
method as a tie-breaker).BugInstance| Modifier and Type | Class and Description |
|---|---|
static class |
SortedBugCollection.BugInstanceComparator |
static class |
SortedBugCollection.MultiversionBugInstanceComparator |
ANALYSIS_ERROR_ELEMENT_NAME, APP_CLASS_ELEMENT_NAME, CLASS_HASHES_ELEMENT_NAME, ERROR_ELEMENT_NAME, ERROR_EXCEPTION_ELEMENT_NAME, ERROR_MESSAGE_ELEMENT_NAME, ERROR_STACK_TRACE_ELEMENT_NAME, ERRORS_ELEMENT_NAME, HISTORY_ELEMENT_NAME, MISSING_CLASS_ELEMENT_NAME, PROJECT_ELEMENT_NAME, ROOT_ELEMENT_NAME, SRCMAP_ELEMENT_NAME, SUMMARY_HTML_ELEMENT_NAME| Constructor and Description |
|---|
SortedBugCollection()
Constructor.
|
SortedBugCollection(java.util.Comparator<BugInstance> comparator)
Constructor.
|
SortedBugCollection(java.io.File f) |
SortedBugCollection(Project project) |
SortedBugCollection(ProjectStats projectStats)
Constructor.
|
SortedBugCollection(ProjectStats projectStats,
java.util.Comparator<BugInstance> comparator)
Constructor.
|
SortedBugCollection(ProjectStats projectStats,
java.util.Comparator<BugInstance> comparator,
Project project) |
SortedBugCollection(ProjectStats projectStats,
Project project) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(BugInstance bugInstance)
Add a BugInstance to this BugCollection.
|
boolean |
add(BugInstance bugInstance,
boolean updateActiveTime)
Add a BugInstance to this BugCollection.
|
void |
addAll(java.util.Collection<BugInstance> collection)
Add a Collection of BugInstances to this BugCollection object.
|
void |
addAll(java.util.Collection<BugInstance> collection,
boolean updateActiveTime)
Add a Collection of BugInstances to this BugCollection object.
|
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 |
addError(java.lang.String message,
java.lang.Throwable exception) |
void |
addMissingClass(java.lang.String className)
Add a missing class message.
|
java.util.Iterator<AppVersion> |
appVersionIterator()
Get an Iterator over AppVersions defined in the collection.
|
void |
bugsPopulated() |
java.util.Iterator<ClassFeatureSet> |
classFeatureSetIterator() |
void |
clearAppVersions()
Clear all AppVersions representing previously-analyzed versions of the
application.
|
void |
clearBugInstances() |
void |
clearClassFeatures() |
void |
clearCloud() |
void |
clearErrors() |
void |
clearMissingClasses() |
static void |
cloneAll(java.util.Collection<BugInstance> dest,
java.util.Collection<BugInstance> source)
Clone all of the BugInstance objects in the source Collection and add
them to the destination Collection.
|
void |
computeBugHashes() |
boolean |
contains(BugInstance bugInstance) |
SortedBugCollection |
createEmptyCollectionWithMetadata()
Create a new empty BugCollection with the same metadata as this one.
|
SortedBugCollection |
duplicate() |
BugInstance |
findBug(java.lang.String instanceHash,
java.lang.String bugType,
int lineNumber) |
long |
getAnalysisTimestamp()
Get the timestamp for when the analysis was performed.
|
java.lang.String |
getAnalysisVersion() |
AppVersion |
getAppVersionFromSequenceNumber(long target)
Gets the AppVersion corresponding to the given sequence number.
|
ClassFeatureSet |
getClassFeatureSet(java.lang.String className) |
Cloud |
getCloud()
Get the instance of user annotation plugin
|
Cloud |
getCloudLazily() |
java.util.Collection<BugInstance> |
getCollection()
Return the Collection storing the BugInstance objects.
|
AppVersion |
getCurrentAppVersion()
Get the current AppVersion.
|
java.lang.String |
getDataSource() |
java.util.Collection<? extends AnalysisError> |
getErrors() |
BugInstance |
getMatching(BugInstance bugInstance) |
Project |
getProject() |
ProjectStats |
getProjectStats()
Get the project stats.
|
java.lang.String |
getReleaseName()
Get the current release name.
|
long |
getSequenceNumber()
Get the sequence number of the BugCollection.
|
java.lang.String |
getSummaryHTML() |
long |
getTimeFinishedLoading() |
long |
getTimestamp()
Get the timestamp for the analyzed code (when it was compiled)
|
long |
getTimeStartedLoading() |
boolean |
getWithMessages()
Return whether textual messages will be added to any generated XML
|
java.util.Map<java.lang.String,java.lang.String> |
getXmlCloudDetails() |
boolean |
hasDeadBugs() |
boolean |
isApplySuppressions() |
boolean |
isMultiversion()
Returns whether this bug collection contains results from multiple analysis runs,
either of different version of the software or from different versions of FindBugs.
|
java.util.Iterator<BugInstance> |
iterator()
Return an Iterator over all the BugInstance objects in the BugCollection.
|
BugInstance |
lookupFromUniqueId(java.lang.String uniqueId)
Deprecated.
|
java.util.Iterator<java.lang.String> |
missingClassIterator() |
java.io.InputStream |
progessMonitoredInputStream(java.io.File f,
java.lang.String msg) |
java.io.InputStream |
progessMonitoredInputStream(java.net.URLConnection c,
java.lang.String msg) |
java.io.InputStream |
progressMonitoredInputStream(java.io.InputStream in,
int length,
java.lang.String msg) |
void |
readXML(java.io.File file)
Read XML data from given file into this object, populating given Project
as a side effect.
|
void |
readXML(java.io.InputStream in)
Read XML data from given input stream into this object, populating the
Project as a side effect.
|
void |
readXML(java.io.InputStream in,
java.io.File base)
Read XML data from given input stream into this object, populating the
Project as a side effect.
|
void |
readXML(java.io.Reader reader)
Read XML data from given reader into this object, populating the Project
as a side effect.
|
void |
readXML(java.lang.String fileName)
Read XML data from given file into this object, populating given Project
as a side effect.
|
void |
readXML(java.net.URL u) |
Cloud |
reinitializeCloud() |
boolean |
remove(BugInstance bugInstance) |
void |
setAnalysisTimestamp(long timestamp)
Set the timestamp for when the analysis was performed.
|
void |
setAnalysisVersion(java.lang.String version)
Set the version of FindBugs used to perform the analysis
|
void |
setApplySuppressions(boolean applySuppressions) |
void |
setClassFeatureSet(ClassFeatureSet classFeatureSet) |
void |
setDoNotUseCloud(boolean b) |
void |
setMinimalXML(boolean minimalXML)
Set whether we should minimize XML
|
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 (when it was compiled)
|
void |
setWithMessages(boolean withMessages)
Set whether textual messages should be added to any generated XML
|
void |
setXmlCloudDetails(java.util.Map<java.lang.String,java.lang.String> map) |
org.dom4j.Document |
toDocument()
Convert the BugCollection into a dom4j Document object.
|
void |
trimAppVersions(long numberToRetain) |
java.io.InputStream |
wrapGzip(java.io.InputStream in,
java.lang.Object source) |
void |
writeEpilogue(XMLOutput xmlOutput) |
void |
writePrologue(XMLOutput xmlOutput) |
void |
writeXML(java.io.File file)
Write this BugCollection to a file as XML.
|
void |
writeXML(java.io.OutputStream out)
Write the BugCollection to given output stream as XML using a UTF8 encoding.
|
void |
writeXML(java.lang.String fileName)
Write this BugCollection to a file as XML.
|
void |
writeXML(java.io.Writer out)
Write the BugCollection to given output stream as XML.
|
void |
writeXML(XMLOutput xmlOutput)
Write the BugCollection to an XMLOutput object.
|
public SortedBugCollection(Project project)
public SortedBugCollection(java.io.File f)
throws java.io.IOException,
org.dom4j.DocumentException
java.io.IOExceptionorg.dom4j.DocumentExceptionpublic SortedBugCollection()
public SortedBugCollection(java.util.Comparator<BugInstance> comparator)
public SortedBugCollection(ProjectStats projectStats)
projectStats - the ProjectStatspublic SortedBugCollection(ProjectStats projectStats, Project project)
public SortedBugCollection(ProjectStats projectStats, java.util.Comparator<BugInstance> comparator)
projectStats - the ProjectStatscomparator - to use for sorting bug instancespublic SortedBugCollection(ProjectStats projectStats, java.util.Comparator<BugInstance> comparator, Project project)
public long getTimeStartedLoading()
public long getTimeFinishedLoading()
public java.lang.String getDataSource()
public Project getProject()
getProject in interface BugCollection@CheckForNull public Cloud getCloudLazily()
getCloudLazily in interface BugCollection@Nonnull public Cloud getCloud()
BugCollectiongetCloud in interface BugCollectionpublic boolean isApplySuppressions()
isApplySuppressions in interface BugCollectionpublic void setApplySuppressions(boolean applySuppressions)
setApplySuppressions in interface BugCollectionpublic long getAnalysisTimestamp()
BugCollectiongetAnalysisTimestamp in interface BugCollectionpublic void setAnalysisTimestamp(long timestamp)
BugCollectionsetAnalysisTimestamp in interface BugCollectiontimestamp - the analysis timestamp.public void addAll(java.util.Collection<BugInstance> collection)
collection - the Collection of BugInstances to addpublic void addAll(java.util.Collection<BugInstance> collection, boolean updateActiveTime)
collection - the Collection of BugInstances to addupdateActiveTime - true if active time of added BugInstances should be updated to
match collection: false if notpublic boolean add(BugInstance bugInstance)
add in interface BugCollectionbugInstance - the BugInstancepublic void addError(java.lang.String message)
addError in interface BugCollectionmessage - the error messagepublic AppVersion getCurrentAppVersion()
getCurrentAppVersion in interface BugCollectionpublic void readXML(java.lang.String fileName)
throws java.io.IOException,
org.dom4j.DocumentException
readXML in interface BugCollectionfileName - name of the file to readjava.io.IOExceptionorg.dom4j.DocumentExceptionpublic void readXML(java.io.File file)
throws java.io.IOException,
org.dom4j.DocumentException
file - the filejava.io.IOExceptionorg.dom4j.DocumentExceptionpublic void readXML(java.net.URL u)
throws java.io.IOException,
org.dom4j.DocumentException
java.io.IOExceptionorg.dom4j.DocumentExceptionpublic void readXML(@WillClose
java.io.InputStream in,
java.io.File base)
throws java.io.IOException,
org.dom4j.DocumentException
in - the InputStreamjava.io.IOExceptionorg.dom4j.DocumentExceptionpublic void readXML(@WillClose
java.io.InputStream in)
throws java.io.IOException,
org.dom4j.DocumentException
BugCollectionreadXML in interface BugCollectionin - the InputStreamjava.io.IOExceptionorg.dom4j.DocumentExceptionpublic void readXML(@WillClose
java.io.Reader reader)
throws java.io.IOException,
org.dom4j.DocumentException
BugCollectionreadXML in interface BugCollectionreader - the Readerjava.io.IOExceptionorg.dom4j.DocumentExceptionpublic void writeXML(java.io.OutputStream out)
throws java.io.IOException
BugCollectionwriteXML in interface BugCollectionout - the OutputStream to write tojava.io.IOExceptionpublic void writeXML(java.lang.String fileName)
throws java.io.IOException
writeXML in interface BugCollectionfileName - the file to write tojava.io.IOExceptionpublic void writeXML(java.io.File file)
throws java.io.IOException
file - the file to write tojava.io.IOExceptionpublic org.dom4j.Document toDocument()
toDocument in interface BugCollectionpublic void writeXML(@WillClose
java.io.Writer out)
throws java.io.IOException
writeXML in interface BugCollectionout - the OutputStream to write tojava.io.IOExceptionpublic void writePrologue(XMLOutput xmlOutput) throws java.io.IOException
writePrologue in interface BugCollectionjava.io.IOExceptionpublic void computeBugHashes()
public void writeXML(@WillClose
XMLOutput xmlOutput)
throws java.io.IOException
To write the SummaryHTML element, set property findbugs.report.SummaryHTML to "true".
writeXML in interface BugCollectionxmlOutput - the XMLOutput objectjava.io.IOExceptionpublic void writeEpilogue(XMLOutput xmlOutput) throws java.io.IOException
writeEpilogue in interface BugCollectionjava.io.IOExceptionpublic static void cloneAll(java.util.Collection<BugInstance> dest, java.util.Collection<BugInstance> source)
dest - the destination Collectionsource - the source Collectionpublic boolean add(BugInstance bugInstance, boolean updateActiveTime)
BugCollectionadd in interface BugCollectionbugInstance - the BugInstanceupdateActiveTime - true if the warning's active time should be updated to include
the collection's current timepublic boolean remove(BugInstance bugInstance)
public java.util.Iterator<BugInstance> iterator()
BugCollectioniterator in interface BugCollectioniterator in interface java.lang.Iterable<BugInstance>public java.util.Collection<BugInstance> getCollection()
BugCollectiongetCollection in interface BugCollectionpublic void addError(java.lang.String message,
java.lang.Throwable exception)
public void addError(AnalysisError error)
BugCollectionaddError in interface BugCollectionerror - the AnalysisError object to addpublic void clearErrors()
public void addMissingClass(java.lang.String className)
BugCollectionaddMissingClass in interface BugCollectionclassName - the missing class messagepublic java.util.Collection<? extends AnalysisError> getErrors()
public java.util.Iterator<java.lang.String> missingClassIterator()
public boolean contains(BugInstance bugInstance)
public BugInstance getMatching(BugInstance bugInstance)
public java.lang.String getSummaryHTML()
throws java.io.IOException
java.io.IOExceptionpublic ProjectStats getProjectStats()
BugCollectiongetProjectStats in interface BugCollection@Deprecated public BugInstance lookupFromUniqueId(java.lang.String uniqueId)
BugCollectionlookupFromUniqueId in interface BugCollectionuniqueId - the BugInstance's unique id.public boolean isMultiversion()
isMultiversion in interface BugCollectionpublic boolean hasDeadBugs()
hasDeadBugs in interface BugCollectionpublic long getSequenceNumber()
BugCollectiongetSequenceNumber in interface BugCollectionpublic void setSequenceNumber(long sequence)
BugCollectionsetSequenceNumber in interface BugCollectionsequence - the sequence numberBugCollection.getSequenceNumber()public SortedBugCollection duplicate()
public SortedBugCollection createEmptyCollectionWithMetadata()
BugCollectioncreateEmptyCollectionWithMetadata in interface BugCollectionpublic void clearBugInstances()
public void clearMissingClasses()
clearMissingClasses in interface BugCollectionpublic java.lang.String getReleaseName()
BugCollectiongetReleaseName in interface BugCollectionpublic void setReleaseName(java.lang.String releaseName)
BugCollectionsetReleaseName in interface BugCollectionreleaseName - the current release namepublic java.util.Iterator<AppVersion> appVersionIterator()
BugCollectionappVersionIterator in interface BugCollectionpublic void addAppVersion(AppVersion appVersion)
BugCollectionaddAppVersion in interface BugCollectionappVersion - the AppVersionpublic void clearAppVersions()
BugCollectionclearAppVersions in interface BugCollectionpublic void trimAppVersions(long numberToRetain)
public void setTimestamp(long timestamp)
BugCollectionsetTimestamp in interface BugCollectiontimestamp - the timestamp.public long getTimestamp()
BugCollectiongetTimestamp in interface BugCollectionpublic ClassFeatureSet getClassFeatureSet(java.lang.String className)
public void setClassFeatureSet(ClassFeatureSet classFeatureSet)
setClassFeatureSet in interface BugCollectionpublic java.util.Iterator<ClassFeatureSet> classFeatureSetIterator()
public void clearClassFeatures()
clearClassFeatures in interface BugCollectionpublic void setWithMessages(boolean withMessages)
BugCollectionsetWithMessages in interface BugCollectionpublic boolean getWithMessages()
BugCollectiongetWithMessages in interface BugCollectionpublic AppVersion getAppVersionFromSequenceNumber(long target)
BugCollectiongetAppVersionFromSequenceNumber in interface BugCollectionpublic BugInstance findBug(java.lang.String instanceHash, java.lang.String bugType, int lineNumber)
findBug in interface BugCollectionpublic void setAnalysisVersion(java.lang.String version)
BugCollectionsetAnalysisVersion in interface BugCollectionversion - the analysis version.public java.lang.String getAnalysisVersion()
public java.io.InputStream progessMonitoredInputStream(java.io.File f,
java.lang.String msg)
throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream progessMonitoredInputStream(java.net.URLConnection c,
java.lang.String msg)
throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream progressMonitoredInputStream(java.io.InputStream in,
int length,
java.lang.String msg)
public java.io.InputStream wrapGzip(java.io.InputStream in,
java.lang.Object source)
public void clearCloud()
@Nonnull public Cloud reinitializeCloud()
reinitializeCloud in interface BugCollectionpublic void setXmlCloudDetails(java.util.Map<java.lang.String,java.lang.String> map)
setXmlCloudDetails in interface BugCollectionpublic java.util.Map<java.lang.String,java.lang.String> getXmlCloudDetails()
getXmlCloudDetails in interface BugCollectionpublic void setMinimalXML(boolean minimalXML)
BugCollectionsetMinimalXML in interface BugCollectionpublic void setDoNotUseCloud(boolean b)
public void bugsPopulated()
bugsPopulated in interface BugCollectionFindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.