From 5adcd708e4822f77032ef687ac0a7dbcdc852474 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 19 Aug 2010 11:46:22 -0700 Subject: [PATCH] Make ObjectId.hashCode final too 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 --- org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java index aeb0812c4d..bee5ff9ef2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java @@ -219,7 +219,7 @@ public abstract class AnyObjectId implements Comparable { return abbr.prefixCompare(this) == 0; } - public int hashCode() { + public final int hashCode() { return w2; } -- 2.39.5