Skip to content
This repository
Browse code

properly reinitialize the script cache

  • Loading branch information...
commit 25eff098cfddfbb29be394daf547a6b88e6ea89b 1 parent 58375af
Carlo Sciolla authored December 02, 2011
5  src/main/java/org/springframework/extensions/webscripts/processor/ClojureScriptProcessor.java
@@ -18,7 +18,7 @@
18 18
 public class ClojureScriptProcessor extends AbstractScriptProcessor {
19 19
     private static final Log log = LogFactory.getLog(ClojureScriptProcessor.class);
20 20
 
21  
-    private final Map<String, WebScript> compiledWebScripts =
  21
+    private Map<String, WebScript> compiledWebScripts =
22 22
             Collections.synchronizedMap(new HashMap<String,WebScript>());
23 23
 
24 24
     /* (non-Javadoc)
@@ -97,7 +97,7 @@ public Object executeScript(ScriptContent scriptContent, Map<String, Object> mod
97 97
             throw new ScriptException("Cannot compile Clojure web script at path " + path);
98 98
         }
99 99
 
100  
-        synchronized (this.compiledWebScripts) {
  100
+        synchronized (this) {
101 101
             if (log.isDebugEnabled()) {
102 102
                 log.debug("Caching Clojure webscript at path " + path);
103 103
             }
@@ -121,5 +121,6 @@ public Object unwrapValue(Object value) {
121 121
 
122 122
     public void reset() {
123 123
         init();
  124
+        this.compiledWebScripts = Collections.synchronizedMap(new HashMap<String,WebScript>());
124 125
     }
125 126
 }

0 notes on commit 25eff09

Please sign in to comment.
Something went wrong with that request. Please try again.