X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fanalyze%2FAnalysis.java;h=81f4b89bad189a0722e89a2c28d3ebdd99d9636f;hp=ab9fffbe798e90b8d23d52a3347008ec931316e3;hb=2769cf82ccae57ee3716aecc9bd694be1f115d92;hpb=88c635ae6a039a873cba2d794c55d726dcdc616d diff --git a/prod/net/jaekl/cfb/analyze/Analysis.java b/prod/net/jaekl/cfb/analyze/Analysis.java index ab9fffb..81f4b89 100644 --- a/prod/net/jaekl/cfb/analyze/Analysis.java +++ b/prod/net/jaekl/cfb/analyze/Analysis.java @@ -5,6 +5,7 @@ package net.jaekl.cfb.analyze; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; +import java.util.Date; import net.jaekl.cfb.xml.BugCollection; import net.jaekl.qd.xml.ParseErrorHandler; @@ -16,13 +17,33 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; public class Analysis { + long m_id; BugCollection m_bugCollection; + String m_projectName; + String m_buildNumber; + long m_start; // Date.getTime() when analysis was started + long m_end; - public Analysis() { + public Analysis(String projectName, String buildNumber) { + m_id = (-1); m_bugCollection = null; + m_projectName = projectName; + m_buildNumber = buildNumber; + m_start = new Date().getTime(); + m_end = 0; } public BugCollection getBugCollection() { return m_bugCollection; } + public long getId() { return m_id; } + public String getProjectName() { return m_projectName; } + public String getBuildNumber() { return m_buildNumber; } + public Date getStart() { return new Date(m_start); } + public Date getEnd() { return (0 == m_end ? null : new Date(m_end)); } // the end time (when FindBugs was done analyzing) + + public void setBugCollection(BugCollection bugs) { m_bugCollection = bugs; } + public void setId(long id) { m_id = id; } + public void setStart(Date start) { m_start = start.getTime(); } + public void setEnd(Date date) { m_end = date.getTime(); } public void parse(InputSource xml) throws FileNotFoundException, IOException, SAXException { @@ -36,6 +57,7 @@ public class Analysis { reader.parse(xml); } + public void dump(PrintWriter pw) { if (null != m_bugCollection) {