|
FindBugs™ 1.3.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.SortedBugCollection
public class SortedBugCollection
An implementation of BugCollection
that keeps the BugInstances
sorted by class (using the native comparison ordering of BugInstance's
compareTo() method as a tie-breaker).
BugInstance
Nested Class Summary | |
---|---|
static class |
SortedBugCollection.BugInstanceComparator
|
static class |
SortedBugCollection.MultiversionBugInstanceComparator
|
Field Summary |
---|
Constructor Summary | |
---|---|
SortedBugCollection()
Constructor. |
|
SortedBugCollection(java.util.Comparator<BugInstance> comparator)
Constructor. |
|
SortedBugCollection(ProjectStats projectStats)
Constructor. |
|
SortedBugCollection(ProjectStats projectStats,
java.util.Comparator<BugInstance> comparator)
Constructor. |
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 |
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. |
java.util.Iterator<ClassFeatureSet> |
classFeatureSetIterator()
|
void |
clearAppVersions()
Clear all AppVersions representing previously-analyzed versions of the application. |
void |
clearBugInstances()
|
void |
clearClassFeatures()
|
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()
|
java.util.Iterator<AnalysisError> |
errorIterator()
|
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)
|
java.util.Collection<BugInstance> |
getCollection()
Return the Collection storing the BugInstance objects. |
AppVersion |
getCurrentAppVersion()
Get the current AppVersion. |
BugInstance |
getMatching(BugInstance bugInstance)
|
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 |
getTimestamp()
Get the timestamp for the analyzed code (when it was compiled) |
UserAnnotationPlugin |
getUserAnnotationPlugin()
|
boolean |
getWithMessages()
Return whether textual messages will be added to any generated XML |
boolean |
isApplySuppressions()
|
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()
|
void |
readXML(java.io.File file,
Project project)
Read XML data from given file into this object, populating given Project as a side effect. |
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.io.InputStream in,
Project project,
java.io.File base)
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. |
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 |
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 |
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.File file,
Project project)
Write this BugCollection to a file as XML. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortedBugCollection()
public SortedBugCollection(java.util.Comparator<BugInstance> comparator)
public SortedBugCollection(ProjectStats projectStats)
projectStats
- the ProjectStatspublic SortedBugCollection(ProjectStats projectStats, java.util.Comparator<BugInstance> comparator)
projectStats
- the ProjectStatscomparator
- to use for sorting bug instancesMethod Detail |
---|
@CheckForNull public UserAnnotationPlugin getUserAnnotationPlugin()
getUserAnnotationPlugin
in interface BugCollection
public boolean isApplySuppressions()
isApplySuppressions
in interface BugCollection
public void setApplySuppressions(boolean applySuppressions)
setApplySuppressions
in interface BugCollection
public long getAnalysisTimestamp()
BugCollection
getAnalysisTimestamp
in interface BugCollection
public void setAnalysisTimestamp(long timestamp)
BugCollection
setAnalysisTimestamp
in interface BugCollection
timestamp
- 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 BugCollection
bugInstance
- the BugInstance
public void addError(java.lang.String message)
addError
in interface BugCollection
message
- the error messagepublic AppVersion getCurrentAppVersion()
getCurrentAppVersion
in interface BugCollection
public void readXML(java.lang.String fileName, Project project) throws java.io.IOException, org.dom4j.DocumentException
readXML
in interface BugCollection
fileName
- name of the file to readproject
- the Project
java.io.IOException
org.dom4j.DocumentException
public void readXML(java.io.File file, Project project) throws java.io.IOException, org.dom4j.DocumentException
file
- the fileproject
- the Project
java.io.IOException
org.dom4j.DocumentException
public void readXML(@WillClose java.io.InputStream in, Project project, java.io.File base) throws java.io.IOException, org.dom4j.DocumentException
in
- the InputStreamproject
- the Project
java.io.IOException
org.dom4j.DocumentException
public void readXML(@WillClose java.io.InputStream in, Project project) throws java.io.IOException, org.dom4j.DocumentException
BugCollection
readXML
in interface BugCollection
in
- the InputStreamproject
- the Project
java.io.IOException
org.dom4j.DocumentException
public void writeXML(java.lang.String fileName, Project project) throws java.io.IOException
writeXML
in interface BugCollection
fileName
- the file to write toproject
- the Project from which the BugCollection was generated
java.io.IOException
public void writeXML(java.io.File file, Project project) throws java.io.IOException
file
- the file to write toproject
- the Project from which the BugCollection was generated
java.io.IOException
public org.dom4j.Document toDocument(@Nonnull Project project)
toDocument
in interface BugCollection
project
- the Project from which the BugCollection was generated
public void writeXML(@WillClose java.io.OutputStream out, @Nonnull Project project) throws java.io.IOException
writeXML
in interface BugCollection
out
- the OutputStream to write toproject
- the Project from which the BugCollection was generated
java.io.IOException
public void writePrologue(XMLOutput xmlOutput, Project project) throws java.io.IOException
writePrologue
in interface BugCollection
java.io.IOException
public void computeBugHashes()
public void writeXML(@WillClose XMLOutput xmlOutput, @Nonnull Project project) throws java.io.IOException
To write the SummaryHTML element, set property findbugs.report.SummaryHTML to "true".
writeXML
in interface BugCollection
xmlOutput
- the XMLOutput objectproject
- the Project from which the BugCollection was generated
java.io.IOException
public void writeEpilogue(XMLOutput xmlOutput) throws java.io.IOException
writeEpilogue
in interface BugCollection
java.io.IOException
public 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)
BugCollection
add
in interface BugCollection
bugInstance
- the BugInstanceupdateActiveTime
- true if the warning's active time should be updated
to include the collection's current time
public boolean remove(BugInstance bugInstance)
public java.util.Iterator<BugInstance> iterator()
BugCollection
iterator
in interface BugCollection
iterator
in interface java.lang.Iterable<BugInstance>
public java.util.Collection<BugInstance> getCollection()
BugCollection
getCollection
in interface BugCollection
public void addError(java.lang.String message, java.lang.Throwable exception)
public void addError(AnalysisError error)
BugCollection
addError
in interface BugCollection
error
- the AnalysisError object to addpublic void addMissingClass(java.lang.String className)
BugCollection
addMissingClass
in interface BugCollection
className
- the missing class messagepublic java.util.Iterator<AnalysisError> errorIterator()
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.IOException
public ProjectStats getProjectStats()
BugCollection
getProjectStats
in interface BugCollection
@Deprecated public BugInstance lookupFromUniqueId(java.lang.String uniqueId)
BugCollection
lookupFromUniqueId
in interface BugCollection
uniqueId
- the BugInstance's unique id.
public long getSequenceNumber()
BugCollection
getSequenceNumber
in interface BugCollection
public void setSequenceNumber(long sequence)
BugCollection
setSequenceNumber
in interface BugCollection
sequence
- the sequence numberBugCollection.getSequenceNumber()
public SortedBugCollection duplicate()
public void clearBugInstances()
public java.lang.String getReleaseName()
BugCollection
getReleaseName
in interface BugCollection
public void setReleaseName(java.lang.String releaseName)
BugCollection
setReleaseName
in interface BugCollection
releaseName
- the current release namepublic java.util.Iterator<AppVersion> appVersionIterator()
BugCollection
appVersionIterator
in interface BugCollection
public void addAppVersion(AppVersion appVersion)
BugCollection
addAppVersion
in interface BugCollection
appVersion
- the AppVersionpublic void clearAppVersions()
BugCollection
clearAppVersions
in interface BugCollection
public SortedBugCollection createEmptyCollectionWithMetadata()
BugCollection
createEmptyCollectionWithMetadata
in interface BugCollection
public void setTimestamp(long timestamp)
BugCollection
setTimestamp
in interface BugCollection
timestamp
- the timestamp.public long getTimestamp()
BugCollection
getTimestamp
in interface BugCollection
public ClassFeatureSet getClassFeatureSet(java.lang.String className)
public void setClassFeatureSet(ClassFeatureSet classFeatureSet)
setClassFeatureSet
in interface BugCollection
public java.util.Iterator<ClassFeatureSet> classFeatureSetIterator()
public void clearClassFeatures()
clearClassFeatures
in interface BugCollection
public void setWithMessages(boolean withMessages)
BugCollection
setWithMessages
in interface BugCollection
withMessages
- The withMessages to set.public boolean getWithMessages()
BugCollection
getWithMessages
in interface BugCollection
public AppVersion getAppVersionFromSequenceNumber(long target)
BugCollection
getAppVersionFromSequenceNumber
in interface BugCollection
public BugInstance findBug(java.lang.String instanceHash, java.lang.String bugType, int lineNumber)
findBug
in interface BugCollection
public void setAnalysisVersion(java.lang.String version)
BugCollection
setAnalysisVersion
in interface BugCollection
version
- public java.lang.String getAnalysisVersion()
|
FindBugs™ 1.3.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |