git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH 1/5] Make the equals method work for AnyObjectId, not just ObjectId

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Apr 2, 2009, 18:46 UTC
Message-ID
<1238697991-12990-2-git-send-email-robin.rosenberg@dewire.com>
In-Reply-To
<1238697991-12990-1-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

This has nothing to do with the series, just trying to squeeze it in... The quickdiff fixes works fine with our without this patch, but it seems reasonable.

 .../src/org/spearce/jgit/lib/AnyObjectId.java      |    4 ++--
 .../src/org/spearce/jgit/revwalk/RevObject.java    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
index e2f70ca..2e3a43e 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
@@ -248,12 +248,12 @@ public int hashCode() {
 	 *            the other id to compare to. May be null.
 	 * @return true only if both ObjectIds have identical bits.
 	 */
-	public boolean equals(final ObjectId other) {
+	public boolean equals(final AnyObjectId other) {
 		return other != null ? equals(this, other) : false;
 	}
 
 	public boolean equals(final Object o) {
-		return equals((ObjectId) o);
+		return equals((AnyObjectId) o);
 	}
 
 	/**
diff --git a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevObject.java b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevObject.java
index e8fb29f..1a13d0a 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevObject.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevObject.java
@@ -75,7 +75,7 @@ public final ObjectId getId() {
 	}
 
 	@Override
-	public final boolean equals(final ObjectId o) {
+	public final boolean equals(final AnyObjectId o) {
 		return this == o;
 	}
 
-- 
1.6.2.1.345.g89fb
Previous: Robin RosenbergNext: Robin Rosenberg
Message 2 of 11 in “Quickdiff improvements”
  1. 0/5 Quickdiff improvementsRobin Rosenberg, Apr 2, 2009
  2. 1/5 Make the equals method work for AnyObjectId, not just ObjectIdRobin Rosenberg, Apr 2, 2009
  3. 2/5 quickdiff - Don't add GitDocument as repository listener more than onceRobin Rosenberg, Apr 2, 2009
  4. 3/5 Move dcocument to repository mapping to GitDocumentRobin Rosenberg, Apr 2, 2009
  5. 4/5 Update Quickdiff tracing statementsRobin Rosenberg, Apr 2, 2009
  6. 5/5 Cache resolved ids in quickdiff document for faster updateRobin Rosenberg, Apr 2, 2009
  7. Shawn O. PearceApr 5, 2009
  8. Robin RosenbergApr 5, 2009
  9. Shawn O. PearceApr 5, 2009
  10. Shawn O. PearceApr 5, 2009
  11. Robin RosenbergApr 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.