]> source.dussan.org Git - jgit.git/commitdiff
Make BinaryBlobException stackless 04/187204/3
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 31 Oct 2021 23:53:10 +0000 (00:53 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 16 Nov 2021 10:45:57 +0000 (11:45 +0100)
We use BinaryBlobException to signal a binary blob was found and never
make use of its stack trace. Suppress filling in the stack trace to
avoid the performance penalty coming with that.

See https://shipilev.net/blog/2014/exceptional-performance/

Change-Id: Iae1f1c19a1fa8aef4f6569822557171130299958

org.eclipse.jgit/src/org/eclipse/jgit/errors/BinaryBlobException.java

index 58a121403f5c8885423b6a9976cd5bdf2053876c..768931ca0ba5b5dae0da162b94ad7d1de72a3825 100644 (file)
@@ -22,4 +22,9 @@ public class BinaryBlobException extends Exception {
         * Construct a BinaryBlobException.
         */
        public BinaryBlobException() {}
+
+       @Override
+       public synchronized Throwable fillInStackTrace() {
+               return this;
+       }
 }