From c228f201a6b53ba33421380b6dcb854c315a3f3e Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 19 Dec 2017 14:08:38 +0900 Subject: [PATCH] LargeObjectException: Add constructor that takes Throwable Change-Id: I500959286075f8ba4d0aa5820febd28c9c94ea1b Signed-off-by: David Pursehouse --- .../org/eclipse/jgit/errors/LargeObjectException.java | 11 +++++++++++ .../internal/storage/file/LargePackedWholeObject.java | 4 +--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/LargeObjectException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/LargeObjectException.java index 8873f7e680..dfdf50d35d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/LargeObjectException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/LargeObjectException.java @@ -64,6 +64,17 @@ public class LargeObjectException extends RuntimeException { // Do nothing. } + /** + * Create a large object exception, where the object isn't known. + * + * @param cause + * the cause + * @since 4.10 + */ + public LargeObjectException(Throwable cause) { + initCause(cause); + } + /** * Create a large object exception, naming the object that is too big. * diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LargePackedWholeObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LargePackedWholeObject.java index 229d3ff247..8c42aaa2b7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LargePackedWholeObject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LargePackedWholeObject.java @@ -101,9 +101,7 @@ class LargePackedWholeObject extends ObjectLoader { try { throw new LargeObjectException(getObjectId()); } catch (IOException cannotObtainId) { - LargeObjectException err = new LargeObjectException(); - err.initCause(cannotObtainId); - throw err; + throw new LargeObjectException(cannotObtainId); } } -- 2.39.5