aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core
diff options
context:
space:
mode:
authorPeter Gromov <peter@jetbrains.com>2020-05-26 13:03:30 +0200
committerPeter Gromov <peter@jetbrains.com>2020-05-26 13:03:30 +0200
commit95e4623cc3f899edc70af2abd49e92606d3eea0e (patch)
tree7f0bbf83d28164bb413c4bb399dd17eb394b5634 /velocity-engine-core
parent5944aa9200410cdee784304d2970b69e37a5c141 (diff)
downloadapache-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.java7
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;