RelatedChangesSorter.PatchSetData: Add missing equals method

This class was implementing hashCode() but had no equals method.

Change-Id: Ib54862f2507eb4b2d54846e785ca9bd0cc561c16
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2018-02-14 09:42:34 +01:00
parent 74fa14c3bc
commit 0705881a1e

View File

@@ -275,5 +275,15 @@ class RelatedChangesSorter {
public int hashCode() {
return Objects.hash(patchSet().getId(), commit());
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof PatchSetData)) {
return false;
}
PatchSetData o = (PatchSetData) obj;
return Objects.equals(patchSet().getId(), o.patchSet().getId())
&& Objects.equals(commit(), o.commit());
}
}
}