@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((bugPattern == null) ? 0 : bugPattern.hashCode()); result = prime * result + ((bugPosition == null) ? 0 : bugPosition.hashCode()); result = prime * result + ((fixInformation == null) ? 0 : fixInformation.hashCode()); return result; }
public BugInstance merge(BugInstance other) { if (other == null) { return this; } if (!getKey().equals(other.getKey())) { throw new AssertionError("Only bug instances with the same keys can be merged."); } return new BugInstance( bugPattern, bugPosition, fixInformation.merge(other.getFixInformation())); }
public boolean portableEquals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BugInstance other = (BugInstance) obj; if (bugPattern == null) { if (other.bugPattern != null) return false; } else if (!bugPattern.equals(other.bugPattern)) return false; if (bugPosition == null) { if (other.bugPosition != null) return false; } else if (!bugPosition.portableEquals(other.bugPosition)) return false; if (fixInformation == null) { if (other.fixInformation != null) return false; } else if (!fixInformation.equals(other.fixInformation)) return false; return true; }