]> source.dussan.org Git - jgit.git/commitdiff
LargeObjectException: Add constructor that takes Throwable 62/114362/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 19 Dec 2017 05:08:38 +0000 (14:08 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 19 Dec 2017 14:27:53 +0000 (23:27 +0900)
Change-Id: I500959286075f8ba4d0aa5820febd28c9c94ea1b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/errors/LargeObjectException.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LargePackedWholeObject.java

index 8873f7e6805fa31494e838004376778ce3f45d46..dfdf50d35d1f0d7d79b1763cad87ef9f6cdeb0e3 100644 (file)
@@ -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.
         *
index 229d3ff247ef7d7228755ca0a75414e8afacacb8..8c42aaa2b7aa611c41fef00cea8abe919b114188 100644 (file)
@@ -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);
                }
        }