diff options
author | Peter Gromov <peter@jetbrains.com> | 2020-05-26 13:03:30 +0200 |
---|---|---|
committer | Peter Gromov <peter@jetbrains.com> | 2020-05-26 13:03:30 +0200 |
commit | 95e4623cc3f899edc70af2abd49e92606d3eea0e (patch) | |
tree | 7f0bbf83d28164bb413c4bb399dd17eb394b5634 /velocity-engine-core | |
parent | 5944aa9200410cdee784304d2970b69e37a5c141 (diff) | |
download | apache-velocity-engine-95e4623cc3f899edc70af2abd49e92606d3eea0e.tar.gz |
don't leak classes via Stop.STOP_ALL stack trace
this prevented garbage-collecting classloaders that accidentally happened to be in the stack trace when Stop class was first accessed
Diffstat (limited to 'velocity-engine-core')
-rw-r--r-- | velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Stop.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Stop.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Stop.java index 3df68991..1ffe0170 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Stop.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Stop.java @@ -36,7 +36,12 @@ import java.util.ArrayList; */ public class Stop extends Directive { - private static final StopCommand STOP_ALL = new StopCommand("StopCommand to exit merging"); + private static final StopCommand STOP_ALL = new StopCommand("StopCommand to exit merging") { + @Override + public synchronized Throwable fillInStackTrace() { + return this; + } + }; private boolean hasMessage = false; |