Address EI_EXPOSE_REP and EI_EXPOSE_REP2 FindBugs warnings.
[cfb.git] / prod / net / jaekl / cfb / analyze / Analysis.java
index e2f090f32b0245c701532c27606d2c7b01c0d979..70bad863e00d6b858a625a7019cffa5b40de781d 100644 (file)
@@ -17,17 +17,30 @@ import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
 
 public class Analysis {
+       long m_id;
        BugCollection m_bugCollection;
        String m_buildNumber;
-       Date m_date;    // Date/time when analysis was started
+       long m_start;   // Date.getTime() when analysis was started
+       long m_end;
        
        public Analysis(String buildNumber) {
+               m_id = (-1);
                m_bugCollection = null;
                m_buildNumber = buildNumber;
-               m_date = new Date();
+               m_start = new Date().getTime();
+               m_end = 0;
        }
        
        public BugCollection getBugCollection() { return m_bugCollection; }
+       public long getId() { return m_id; }
+       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 
        {
@@ -41,6 +54,7 @@ public class Analysis {
            reader.parse(xml);
        }
        
+       
        public void dump(PrintWriter pw)
        {
                if (null != m_bugCollection) {