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

[JGIT PATCH 1/5] Remove throws IOException from UnpackedObjectLoader.getCachedBytes

From
Shawn O. Pearce <spearce@spearce.org>
Date
Apr 23, 2009, 03:36 UTC
Message-ID
<1240457783-21434-2-git-send-email-spearce@spearce.org>
In-Reply-To
<1240457783-21434-1-git-send-email-spearce@spearce.org>

The UnpackedObjectLoader always fully materializes itself during the object's constructor. Thus the cached bytes are always ready on any invocation of getCachedBytes(), and this method will never fail.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../org/spearce/jgit/lib/UnpackedObjectLoader.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/UnpackedObjectLoader.java b/org.spearce.jgit/src/org/spearce/jgit/lib/UnpackedObjectLoader.java
index 7552b42..1352b72 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/UnpackedObjectLoader.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/UnpackedObjectLoader.java
@@ -201,7 +201,7 @@ public long getSize() {
 	}
 
 	@Override
-	public byte[] getCachedBytes() throws IOException {
+	public byte[] getCachedBytes() {
 		return bytes;
 	}
 
-- 
1.6.3.rc1.205.g37f8
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 2 of 6 in “Make ObjectLoader safer during repack”
  1. 0/5 Make ObjectLoader safer during repackShawn O. Pearce, Apr 23, 2009
  2. 1/5 Remove throws IOException from UnpackedObjectLoader.getCachedBytesShawn O. Pearce, Apr 23, 2009
  3. 2/5 Add missing @Override annotations to UnpackedObjectLoaderShawn O. Pearce, Apr 23, 2009
  4. 3/5 Fully materialize an ObjectLoader before returning it from ObjectDatabaseShawn O. Pearce, Apr 23, 2009
  5. 4/5 Test that ObjectLoader stays valid across repacksShawn O. Pearce, Apr 23, 2009
  6. 5/5 Teach PackWriter to recover from removed/replaced packsShawn O. Pearce, Apr 23, 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.