]> source.dussan.org Git - jgit.git/commitdiff
Make ObjectId.hashCode final too 41/1341/1
authorShawn O. Pearce <spearce@spearce.org>
Thu, 19 Aug 2010 18:46:22 +0000 (11:46 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 19 Aug 2010 18:46:22 +0000 (11:46 -0700)
Since equals() is now final and does not permit being overridden,
we should do the same thing with hashCode() to prevent different
subclasses from having different hashing behaviors.  This could
lead to the same mess that we had with different equals() behaviors.

Change-Id: I35a849b6efccee5fe74cc5788a3566a1516004b7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java

index aeb0812c4d7f2a010bb52f450e10ac64d43f2150..bee5ff9ef2e00454f9c87860ed20771d3f0d650d 100644 (file)
@@ -219,7 +219,7 @@ public abstract class AnyObjectId implements Comparable {
                return abbr.prefixCompare(this) == 0;
        }
 
-       public int hashCode() {
+       public final int hashCode() {
                return w2;
        }