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 8873f7e68..dfdf50d35 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 229d3ff24..8c42aaa2b 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); } }