X-Git-Url: http://jaekl.net/gitweb/?a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugCollection.java;h=168c8f1c5787935a5c6badab052d291c2d1e74b0;hb=a4a577abc3f9b2b1147caafd1cb39fa8c2622cd4;hp=8fb78e411ab973b770e30a618d26e82f52ad97ad;hpb=5bc9bbe3fd54b9fc7aa3b92d2d37e95c41b9645a;p=cfb.git diff --git a/prod/net/jaekl/cfb/xml/BugCollection.java b/prod/net/jaekl/cfb/xml/BugCollection.java index 8fb78e4..168c8f1 100644 --- a/prod/net/jaekl/cfb/xml/BugCollection.java +++ b/prod/net/jaekl/cfb/xml/BugCollection.java @@ -2,7 +2,10 @@ package net.jaekl.cfb.xml; import java.io.PrintWriter; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import net.jaekl.cfb.util.Util; import net.jaekl.qd.xml.ParseResult; import net.jaekl.qd.xml.XmlParseException; @@ -19,6 +22,9 @@ public class BugCollection extends ParseResult { m_bugs = new ArrayList(); } + public List getBugs() { return Collections.unmodifiableList(m_bugs); } + public void add(BugInstance bug) { m_bugs.add(bug); } + @Override public void endContents(String uri, String localName, String qName, String chars) throws XmlParseException @@ -47,4 +53,21 @@ public class BugCollection extends ParseResult { } } + @Override + public boolean equals(Object obj) { + if (null == obj) { + return false; + } + if (! (obj instanceof BugCollection)) { + return false; + } + BugCollection other = (BugCollection)obj; + + return Util.listsAreEqual(this.m_bugs, other.m_bugs); + } + + @Override + public int hashCode() { + return Util.objHashCode(m_bugs); + } }