From ea3c96e0c94e8914346a6fa065b6bc40880c7320 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 21 Nov 2019 16:46:29 +0100 Subject: [PATCH] use java 7 exception constructor to avoid filling stacktrace --- .../java/com/github/mustachejava/reflect/GuardedWrapper.java | 4 ---- .../java/com/github/mustachejava/util/GuardException.java | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler/src/main/java/com/github/mustachejava/reflect/GuardedWrapper.java b/compiler/src/main/java/com/github/mustachejava/reflect/GuardedWrapper.java index c03146a53..13b43fc6d 100644 --- a/compiler/src/main/java/com/github/mustachejava/reflect/GuardedWrapper.java +++ b/compiler/src/main/java/com/github/mustachejava/reflect/GuardedWrapper.java @@ -17,10 +17,6 @@ public class GuardedWrapper implements Wrapper { @SuppressWarnings("ThrowableInstanceNeverThrown") protected static final GuardException guardException = new GuardException(); - static { - guardException.setStackTrace(new StackTraceElement[0]); - } - // Array of guards that must be satisfied protected final Guard[] guards; diff --git a/compiler/src/main/java/com/github/mustachejava/util/GuardException.java b/compiler/src/main/java/com/github/mustachejava/util/GuardException.java index da144bd04..fceee4fe3 100644 --- a/compiler/src/main/java/com/github/mustachejava/util/GuardException.java +++ b/compiler/src/main/java/com/github/mustachejava/util/GuardException.java @@ -6,9 +6,10 @@ */ public class GuardException extends RuntimeException { public GuardException() { + super(null, null, false, false); } public GuardException(String message) { - super(message); + super(message, null, false, false); } }