From 1ad2feb7b3d48d8bfedfdd03ee6ca4f599041476 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 28 Jun 2010 10:42:43 -0700 Subject: Remove Repository.openObject(ObjectReader, AnyObjectId) Going through ObjectReader.openObject(AnyObjectId) is faster, but also produces cleaner application level code. The error checking is done inside of the openObject method, which means it can be removed from the application code. Change-Id: Ia927b448d128005e1640362281585023582b1a3a Signed-off-by: Shawn O. Pearce --- .../src/org/eclipse/jgit/iplog/IpLogGenerator.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'org.eclipse.jgit.iplog/src') diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java index f40c3896a0..0d98f24369 100644 --- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java +++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java @@ -78,15 +78,13 @@ import org.eclipse.jgit.diff.EditList; import org.eclipse.jgit.diff.MyersDiff; import org.eclipse.jgit.diff.RawText; import org.eclipse.jgit.errors.ConfigInvalidException; -import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.iplog.Committer.ActiveRange; import org.eclipse.jgit.lib.BlobBasedConfig; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.MutableObjectId; -import org.eclipse.jgit.lib.ObjectLoader; +import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevTree; import org.eclipse.jgit.revwalk.RevWalk; @@ -418,10 +416,7 @@ public class IpLogGenerator { private byte[] openBlob(int side) throws IOException { tw.getObjectId(idbuf, side); - ObjectLoader ldr = db.openObject(curs, idbuf); - if (ldr == null) - throw new MissingObjectException(idbuf.copy(), Constants.OBJ_BLOB); - return ldr.getCachedBytes(); + return curs.openObject(idbuf, Constants.OBJ_BLOB).getCachedBytes(); } /** -- cgit v1.2.3