From e1520fe079abf9b27dbd859c0e186eeee4898f7e Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Sat, 12 Dec 2015 19:39:46 +0900 Subject: [PATCH] Address EI_EXPOSE_REP and EI_EXPOSE_REP2 FindBugs warnings. Making the internal contents of our class mutable by outsiders without our knowledge may be considered harmful. --- prod/net/jaekl/cfb/analyze/Analysis.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/prod/net/jaekl/cfb/analyze/Analysis.java b/prod/net/jaekl/cfb/analyze/Analysis.java index 66c0b88..70bad86 100644 --- a/prod/net/jaekl/cfb/analyze/Analysis.java +++ b/prod/net/jaekl/cfb/analyze/Analysis.java @@ -20,27 +20,27 @@ public class Analysis { long m_id; BugCollection m_bugCollection; String m_buildNumber; - Date m_start; // Date/time when analysis was started - Date m_end; + 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_start = new Date(); - m_end = null; + 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 m_start; } - public Date getEnd() { return m_end; } // the end time (when FindBugs was done analyzing) + 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; } - public void setEnd(Date date) { m_end = date; } + 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 { -- 2.30.2