diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-06-30 19:07:36 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-06-30 19:07:36 -0700 |
commit | 2489088235543732ee0874a090a98b344255a9a7 (patch) | |
tree | ef84990ab19d5f27f48c4b961644de6cb4a9d3b6 | |
parent | d04b7972d891a51b4b4c09128431961fece52e75 (diff) | |
download | jgit-2489088235543732ee0874a090a98b344255a9a7.tar.gz jgit-2489088235543732ee0874a090a98b344255a9a7.zip |
Permit AnyObjectTo to compareTo AnyObjectId
Assume that the argument of compareTo won't be mutated while we
are doing the compare, and support the wider AnyObjectId type so
MutableObjectId is suitable on either side of the compareTo call.
Change-Id: I2a63a496c0a7b04f0e5f27d588689c6d5e149d98
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java | 4 |
1 files changed, 2 insertions, 2 deletions
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 7d08f3d4c9..ecaa82b75a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java @@ -113,7 +113,7 @@ public abstract class AnyObjectId implements Comparable { * @return < 0 if this id comes before other; 0 if this id is equal to * other; > 0 if this id comes after other. */ - public int compareTo(final ObjectId other) { + public int compareTo(final AnyObjectId other) { if (this == other) return 0; @@ -139,7 +139,7 @@ public abstract class AnyObjectId implements Comparable { } public int compareTo(final Object other) { - return compareTo(((ObjectId) other)); + return compareTo(((AnyObjectId) other)); } /** |