aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2017-07-22 10:06:25 -0700
committerShawn Pearce <spearce@spearce.org>2017-07-28 10:20:45 -0700
commit4a00f18e8ed036a6b33c15eb145b95a8e11a15c0 (patch)
treeca5ceb796517f5f76dc9d86b547541e8129f65f5 /org.eclipse.jgit/src/org/eclipse/jgit
parent652a6b033428e6c668333bcf2d510332dca1f8c0 (diff)
downloadjgit-4a00f18e8ed036a6b33c15eb145b95a8e11a15c0.tar.gz
jgit-4a00f18e8ed036a6b33c15eb145b95a8e11a15c0.zip
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
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java2
1 files changed, 1 insertions, 1 deletions
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