Package edu.umd.cs.findbugs.workflow
Class MineBugHistory
- java.lang.Object
-
- edu.umd.cs.findbugs.workflow.MineBugHistory
-
public class MineBugHistory extends java.lang.Object
Mine 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) class
MineBugHistory.MineBugHistoryCommandLine
(package private) static class
MineBugHistory.Version
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
ACTIVE_NOW
(package private) static int
ADDED
(package private) SortedBugCollection
bugCollection
(package private) java.text.SimpleDateFormat
dateFormat
(package private) static int
DEAD
(package private) boolean
formatDates
(package private) static int
NEWCODE
(package private) boolean
noTabs
(package private) static int
REMOVED
(package private) static int
REMOVEDCODE
(package private) static int
RETAINED
(package private) java.util.Map<java.lang.Long,AppVersion>
sequenceToAppVersionMap
(package private) boolean
summary
(package private) static int
TUPLE_SIZE
(package private) MineBugHistory.Version[]
versionList
private static int
WIDTH
(package private) boolean
xml
-
Constructor Summary
Constructors Constructor Description MineBugHistory()
MineBugHistory(SortedBugCollection bugCollection)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(java.io.PrintStream out)
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.void
dumpOriginal(java.io.PrintStream out)
This is how dump() was implemented up to and including version 0.9.5.void
dumpSummary(java.io.PrintStream out)
void
dumpXml(java.io.PrintStream out)
This is how dump() was implemented up to and including version 0.9.5.MineBugHistory
execute()
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.static void
main(java.lang.String[] args)
private static void
pad(int width, java.io.PrintStream out)
emitwidth
space characters toout
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 rightvoid
setBugCollection(SortedBugCollection bugCollection)
void
setFormatDates(boolean value)
void
setNoTabs()
void
setSummary()
void
setXml()
-
-
-
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)
emitwidth
space 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
-
-