From 4a00f18e8ed036a6b33c15eb145b95a8e11a15c0 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Sat, 22 Jul 2017 10:06:25 -0700 Subject: Use w1 for hashCode of AbbreviatedObjectId Very short abbreviations that are under 8 hex digits do not have values in w2. Use w1 as the Java hashCode() instead, so that the prefix of the abbreviation is always included in the hashing function used by any java.util.Collection type. Change-Id: Idaf69f86b62630ba4a022d31b4c293c6d138f557 --- org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java index 29a379e4a6..0567051a90 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java @@ -336,7 +336,7 @@ public final class AbbreviatedObjectId implements Serializable { @Override public int hashCode() { - return w2; + return w1; } @Override -- cgit v1.2.3