diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java index 0406684ea..25acee046 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java @@ -268,7 +268,10 @@ public class PersonIdent { } public int hashCode() { - return getEmailAddress().hashCode() ^ (int) when; + int hc = getEmailAddress().hashCode(); + hc *= 31; + hc += (int) (when / 1000L); + return hc; } public boolean equals(final Object o) { @@ -276,7 +279,7 @@ public class PersonIdent { final PersonIdent p = (PersonIdent) o; return getName().equals(p.getName()) && getEmailAddress().equals(p.getEmailAddress()) - && when == p.when; + && when / 1000L == p.when / 1000L; } return false; }