public class SortedBugCollection extends 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(Comparator<BugInstance> comparator)
Constructor.
|
SortedBugCollection(File f) |
SortedBugCollection(Project project) |
SortedBugCollection(ProjectStats projectStats)
Constructor.
|
SortedBugCollection(ProjectStats projectStats,
Comparator<BugInstance> comparator)
Constructor.
|
SortedBugCollection(ProjectStats projectStats,
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(Collection<BugInstance> collection)
Add a Collection of BugInstances to this BugCollection object.
|
void |
addAll(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(String message)
Add an analysis error.
|
void |
addError(String message,
Throwable exception) |
void |
addMissingClass(String className)
Add a missing class message.
|
Iterator<AppVersion> |
appVersionIterator()
Get an Iterator over AppVersions defined in the collection.
|
void |
bugsPopulated() |
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(Collection<BugInstance> dest,
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(String instanceHash,
String bugType,
int lineNumber) |
long |
getAnalysisTimestamp()
Get the timestamp for when the analysis was performed.
|
String |
getAnalysisVersion() |
AppVersion |
getAppVersionFromSequenceNumber(long target)
Gets the AppVersion corresponding to the given sequence number.
|
ClassFeatureSet |
getClassFeatureSet(String className) |
Cloud |
getCloud()
Get the instance of user annotation plugin
|
Cloud |
getCloudLazily() |
Collection<BugInstance> |
getCollection()
Return the Collection storing the BugInstance objects.
|
AppVersion |
getCurrentAppVersion()
Get the current AppVersion.
|
String |
getDataSource() |
Collection<? extends AnalysisError> |
getErrors() |
BugInstance |
getMatching(BugInstance bugInstance) |
Project |
getProject() |
ProjectStats |
getProjectStats()
Get the project stats.
|
String |
getReleaseName()
Get the current release name.
|
long |
getSequenceNumber()
Get the sequence number of the BugCollection.
|
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
|
Map<String,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.
|
Iterator<BugInstance> |
iterator()
Return an Iterator over all the BugInstance objects in the BugCollection.
|
BugInstance |
lookupFromUniqueId(String uniqueId)
Deprecated.
|
Iterator<String> |
missingClassIterator() |
InputStream |
progessMonitoredInputStream(File f,
String msg) |
InputStream |
progessMonitoredInputStream(URLConnection c,
String msg) |
InputStream |
progressMonitoredInputStream(InputStream in,
int length,
String msg) |
void |
readXML(File file)
Read XML data from given file into this object, populating given Project
as a side effect.
|
void |
readXML(InputStream in)
Read XML data from given input stream into this object, populating the
Project as a side effect.
|
void |
readXML(InputStream in,
File base)
Read XML data from given input stream into this object, populating the
Project as a side effect.
|
void |
readXML(Reader reader)
Read XML data from given reader into this object, populating the Project
as a side effect.
|
void |
readXML(String fileName)
Read XML data from given file into this object, populating given Project
as a side effect.
|
void |
readXML(URL u) |
Cloud |
reinitializeCloud() |
boolean |
remove(BugInstance bugInstance) |
void |
setAnalysisTimestamp(long timestamp)
Set the timestamp for when the analysis was performed.
|
void |
setAnalysisVersion(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(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(Map<String,String> map) |
org.dom4j.Document |
toDocument()
Convert the BugCollection into a dom4j Document object.
|
void |
trimAppVersions(long numberToRetain) |
InputStream |
wrapGzip(InputStream in,
Object source) |
void |
writeEpilogue(XMLOutput xmlOutput) |
void |
writePrologue(XMLOutput xmlOutput) |
void |
writeXML(File file)
Write this BugCollection to a file as XML.
|
void |
writeXML(OutputStream out)
Write the BugCollection to given output stream as XML using a UTF8 encoding.
|
void |
writeXML(String fileName)
Write this BugCollection to a file as XML.
|
void |
writeXML(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(File f) throws IOException, org.dom4j.DocumentException
IOExceptionorg.dom4j.DocumentExceptionpublic SortedBugCollection()
public SortedBugCollection(Comparator<BugInstance> comparator)
public SortedBugCollection(ProjectStats projectStats)
projectStats - the ProjectStatspublic SortedBugCollection(ProjectStats projectStats, Project project)
public SortedBugCollection(ProjectStats projectStats, Comparator<BugInstance> comparator)
projectStats - the ProjectStatscomparator - to use for sorting bug instancespublic SortedBugCollection(ProjectStats projectStats, Comparator<BugInstance> comparator, Project project)
public long getTimeStartedLoading()
public long getTimeFinishedLoading()
public 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(Collection<BugInstance> collection)
collection - the Collection of BugInstances to addpublic void addAll(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(String message)
addError in interface BugCollectionmessage - the error messagepublic AppVersion getCurrentAppVersion()
getCurrentAppVersion in interface BugCollectionpublic void readXML(String fileName) throws IOException, org.dom4j.DocumentException
readXML in interface BugCollectionfileName - name of the file to readIOExceptionorg.dom4j.DocumentExceptionpublic void readXML(File file) throws IOException, org.dom4j.DocumentException
file - the fileIOExceptionorg.dom4j.DocumentExceptionpublic void readXML(URL u) throws IOException, org.dom4j.DocumentException
IOExceptionorg.dom4j.DocumentExceptionpublic void readXML(@WillClose InputStream in, File base) throws IOException, org.dom4j.DocumentException
in - the InputStreamIOExceptionorg.dom4j.DocumentExceptionpublic void readXML(@WillClose InputStream in) throws IOException, org.dom4j.DocumentException
BugCollectionreadXML in interface BugCollectionin - the InputStreamIOExceptionorg.dom4j.DocumentExceptionpublic void readXML(@WillClose Reader reader) throws IOException, org.dom4j.DocumentException
BugCollectionreadXML in interface BugCollectionreader - the ReaderIOExceptionorg.dom4j.DocumentExceptionpublic void writeXML(OutputStream out) throws IOException
BugCollectionwriteXML in interface BugCollectionout - the OutputStream to write toIOExceptionpublic void writeXML(String fileName) throws IOException
writeXML in interface BugCollectionfileName - the file to write toIOExceptionpublic void writeXML(File file) throws IOException
file - the file to write toIOExceptionpublic org.dom4j.Document toDocument()
toDocument in interface BugCollectionpublic void writeXML(@WillClose Writer out) throws IOException
writeXML in interface BugCollectionout - the OutputStream to write toIOExceptionpublic void writePrologue(XMLOutput xmlOutput) throws IOException
writePrologue in interface BugCollectionIOExceptionpublic void computeBugHashes()
public void writeXML(@WillClose XMLOutput xmlOutput) throws IOException
To write the SummaryHTML element, set property findbugs.report.SummaryHTML to "true".
writeXML in interface BugCollectionxmlOutput - the XMLOutput objectIOExceptionpublic void writeEpilogue(XMLOutput xmlOutput) throws IOException
writeEpilogue in interface BugCollectionIOExceptionpublic static void cloneAll(Collection<BugInstance> dest, 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 Iterator<BugInstance> iterator()
BugCollectioniterator in interface BugCollectioniterator in interface Iterable<BugInstance>public Collection<BugInstance> getCollection()
BugCollectiongetCollection in interface BugCollectionpublic void addError(AnalysisError error)
BugCollectionaddError in interface BugCollectionerror - the AnalysisError object to addpublic void clearErrors()
public void addMissingClass(String className)
BugCollectionaddMissingClass in interface BugCollectionclassName - the missing class messagepublic Collection<? extends AnalysisError> getErrors()
public boolean contains(BugInstance bugInstance)
public BugInstance getMatching(BugInstance bugInstance)
public String getSummaryHTML() throws IOException
IOExceptionpublic ProjectStats getProjectStats()
BugCollectiongetProjectStats in interface BugCollection@Deprecated public BugInstance lookupFromUniqueId(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 String getReleaseName()
BugCollectiongetReleaseName in interface BugCollectionpublic void setReleaseName(String releaseName)
BugCollectionsetReleaseName in interface BugCollectionreleaseName - the current release namepublic 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(String className)
public void setClassFeatureSet(ClassFeatureSet classFeatureSet)
setClassFeatureSet in interface BugCollectionpublic 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(String instanceHash, String bugType, int lineNumber)
findBug in interface BugCollectionpublic void setAnalysisVersion(String version)
BugCollectionsetAnalysisVersion in interface BugCollectionversion - the analysis version.public String getAnalysisVersion()
public InputStream progessMonitoredInputStream(File f, String msg) throws IOException
IOExceptionpublic InputStream progessMonitoredInputStream(URLConnection c, String msg) throws IOException
IOExceptionpublic InputStream progressMonitoredInputStream(InputStream in, int length, String msg)
public InputStream wrapGzip(InputStream in, Object source)
public void clearCloud()
@Nonnull public Cloud reinitializeCloud()
reinitializeCloud in interface BugCollectionpublic void setXmlCloudDetails(Map<String,String> map)
setXmlCloudDetails in interface BugCollectionpublic Map<String,String> getXmlCloudDetails()
getXmlCloudDetails in interface BugCollectionpublic void setMinimalXML(boolean minimalXML)
BugCollectionsetMinimalXML in interface BugCollectionpublic void setDoNotUseCloud(boolean b)
public void bugsPopulated()
bugsPopulated in interface BugCollectionCopyright © 2003–2015. All rights reserved.