m_id = id;
m_category = category;
m_type = type;
- m_classes = null;
- m_methods = null;
- m_lines = null;
+
+ m_classes = new ArrayList<BugClass>();
+ m_methods = new ArrayList<BugMethod>();
+ m_lines = new ArrayList<SourceLine>();
+
m_locations = new ArrayList<Location>(Arrays.asList(locations));
m_locals = new ArrayList<LocalVariable>(Arrays.asList(variables));
}
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.
}
}
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;
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;
}