Work toward improving solidity. Add a few more unit tests, and some toString()
[cfb.git] / prod / net / jaekl / cfb / xml / BugCollection.java
index 6fbf4460ec43d0b7105ae06d3b16b3bd7f68cac9..0ce05ecaa888a18455c07db4e401e47fd4de4e13 100644 (file)
@@ -5,6 +5,7 @@ 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;
 
@@ -22,6 +23,7 @@ public class BugCollection extends ParseResult {
        }
        
        public List<BugInstance> 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) 
@@ -51,4 +53,16 @@ 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);
+       }
 }