Package edu.umd.cs.findbugs.workflow
Class MineBugHistory
- java.lang.Object
-
- edu.umd.cs.findbugs.workflow.MineBugHistory
-
public class MineBugHistory extends java.lang.ObjectMine historical information from a BugCollection. The BugCollection should be built using UpdateBugCollection to record the history of analyzing all versions over time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classMineBugHistory.MineBugHistoryCommandLine(package private) static classMineBugHistory.Version
-
Field Summary
Fields Modifier and Type Field Description (package private) static intACTIVE_NOW(package private) static intADDED(package private) SortedBugCollectionbugCollection(package private) java.text.SimpleDateFormatdateFormat(package private) static intDEAD(package private) booleanformatDates(package private) static intNEWCODE(package private) booleannoTabs(package private) static intREMOVED(package private) static intREMOVEDCODE(package private) static intRETAINED(package private) java.util.Map<java.lang.Long,AppVersion>sequenceToAppVersionMap(package private) booleansummary(package private) static intTUPLE_SIZE(package private) MineBugHistory.Version[]versionListprivate static intWIDTH(package private) booleanxml
-
Constructor Summary
Constructors Constructor Description MineBugHistory()MineBugHistory(SortedBugCollection bugCollection)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.io.PrintStream out)voiddumpNoTabs(java.io.PrintStream out)This implementation of dump() tries to better align columns (when viewed with a fixed-width font) by padding with spaces instead of using tabs.voiddumpOriginal(java.io.PrintStream out)This is how dump() was implemented up to and including version 0.9.5.voiddumpSummary(java.io.PrintStream out)voiddumpXml(java.io.PrintStream out)This is how dump() was implemented up to and including version 0.9.5.MineBugHistoryexecute()private intgetKey(boolean activePrevious, boolean activeCurrent)Get key used to classify the presence and/or absence of a BugInstance in successive versions in the history.static voidmain(java.lang.String[] args)private static voidpad(int width, java.io.PrintStream out)emitwidthspace characters tooutprivate static voidprint(int width, boolean alignRight, java.io.PrintStream out, java.lang.Object obj)equivalent to out.print(obj) except it may be padded on the left or rightvoidsetBugCollection(SortedBugCollection bugCollection)voidsetFormatDates(boolean value)voidsetNoTabs()voidsetSummary()voidsetXml()
-
-
-
Field Detail
-
WIDTH
private static final int WIDTH
- See Also:
- Constant Field Values
-
ADDED
static final int ADDED
- See Also:
- Constant Field Values
-
NEWCODE
static final int NEWCODE
- See Also:
- Constant Field Values
-
REMOVED
static final int REMOVED
- See Also:
- Constant Field Values
-
REMOVEDCODE
static final int REMOVEDCODE
- See Also:
- Constant Field Values
-
RETAINED
static final int RETAINED
- See Also:
- Constant Field Values
-
DEAD
static final int DEAD
- See Also:
- Constant Field Values
-
ACTIVE_NOW
static final int ACTIVE_NOW
- See Also:
- Constant Field Values
-
TUPLE_SIZE
static final int TUPLE_SIZE
- See Also:
- Constant Field Values
-
dateFormat
final java.text.SimpleDateFormat dateFormat
-
bugCollection
SortedBugCollection bugCollection
-
versionList
MineBugHistory.Version[] versionList
-
sequenceToAppVersionMap
java.util.Map<java.lang.Long,AppVersion> sequenceToAppVersionMap
-
formatDates
boolean formatDates
-
noTabs
boolean noTabs
-
summary
boolean summary
-
xml
boolean xml
-
-
Constructor Detail
-
MineBugHistory
public MineBugHistory()
-
MineBugHistory
public MineBugHistory(SortedBugCollection bugCollection)
-
-
Method Detail
-
setBugCollection
public void setBugCollection(SortedBugCollection bugCollection)
-
setFormatDates
public void setFormatDates(boolean value)
-
setNoTabs
public void setNoTabs()
-
setXml
public void setXml()
-
setSummary
public void setSummary()
-
execute
public MineBugHistory execute()
-
dump
public void dump(java.io.PrintStream out)
-
dumpSummary
public void dumpSummary(java.io.PrintStream out)
-
dumpOriginal
public void dumpOriginal(java.io.PrintStream out)
This is how dump() was implemented up to and including version 0.9.5.
-
pad
private static void pad(int width, java.io.PrintStream out)emitwidthspace characters toout
-
print
private static void print(int width, boolean alignRight, java.io.PrintStream out, java.lang.Object obj)equivalent to out.print(obj) except it may be padded on the left or right- Parameters:
width- padding will occur if the stringified oxj is shorter than thisalignRight- true to pad on the left, false to pad on the rightout- the PrintStream printed toobj- the value to print (may be an auto-boxed primitive)
-
dumpNoTabs
public void dumpNoTabs(java.io.PrintStream out)
This implementation of dump() tries to better align columns (when viewed with a fixed-width font) by padding with spaces instead of using tabs. Also, timestamps are formatted more tersely (-formatDates option). The bad news is that it requires a minimum of 112 columns.- See Also:
dumpOriginal(PrintStream)
-
dumpXml
public void dumpXml(java.io.PrintStream out)
This is how dump() was implemented up to and including version 0.9.5.
-
getKey
private int getKey(boolean activePrevious, boolean activeCurrent)Get key used to classify the presence and/or absence of a BugInstance in successive versions in the history.- Parameters:
activePrevious- true if the bug was active in the previous version, false if notactiveCurrent- true if the bug is active in the current version, false if not- Returns:
- the key: one of ADDED, RETAINED, REMOVED, and DEAD
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
-