X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugInstance.java;h=0683a7d23c83dd1437b08ebe77bd545d01a830f4;hp=96a815e5aaa41089beafd6599878a83d0e922e3a;hb=769f0f2e9b90516e68246b551a4c68f953018c72;hpb=8e5bdf0294e85b4419ee1e582d5677cccd3f736e diff --git a/prod/net/jaekl/cfb/xml/BugInstance.java b/prod/net/jaekl/cfb/xml/BugInstance.java index 96a815e..0683a7d 100644 --- a/prod/net/jaekl/cfb/xml/BugInstance.java +++ b/prod/net/jaekl/cfb/xml/BugInstance.java @@ -57,9 +57,11 @@ public class BugInstance extends ParseResult { m_id = id; m_category = category; m_type = type; - m_classes = null; - m_methods = null; - m_lines = null; + + m_classes = new ArrayList(); + m_methods = new ArrayList(); + m_lines = new ArrayList(); + m_locations = new ArrayList(Arrays.asList(locations)); m_locals = new ArrayList(Arrays.asList(variables)); } @@ -138,11 +140,18 @@ public class BugInstance extends ParseResult { bm.dump(pw, childIndent); } for (LocalVariable lv : m_locals) { - lv.dump(pw, childIndent); + if (null != lv) { + lv.dump(pw, childIndent); + } } for (SourceLine sl : m_lines) { sl.dump(pw, childIndent); } + for (Location loc : m_locations) { + if (null != loc) { + loc.dump(pw, childIndent); + } + } } // Note that this is a heuristic, "fuzzy", equals. @@ -180,18 +189,11 @@ public class BugInstance extends ParseResult { } } else { - if (! Util.objsAreEqual(thisLoc.getClassName(), thatLoc.getClassName())) { - return false; - } - if (! Util.objsAreEqual(thisLoc.getMethodName(), thatLoc.getMethodName())) { + if (! thisLoc.fuzzyEquals(thatLoc)) { return false; } } - if (! Util.objsAreEqual(this.getVariables(), that.getVariables())) { - return false; - } - return true; } return false; @@ -201,9 +203,8 @@ public class BugInstance extends ParseResult { public int hashCode() { int code = Util.objHashCode(m_type) - * Util.objHashCode(m_category) - * Util.objHashCode(getPrincipalLocation()) - * Util.objHashCode(getVariables()); + ^ Util.objHashCode(m_category) + ^ Util.objHashCode(getPrincipalLocation()); return code; }