Commits

Anonymous committed 22ad274
  • Participants
  • Parent commits 0e6dc9f
  • Branches parameter-binder

Comments (0)

Files changed (1)

File core/src/main/java/com/opensymphony/xwork2/parameters/XWorkParametersBinder.java

     protected Container container;
     private XWorkParametersMapPropertyAccessor mapAccessor;
 
+    private static final Map<String, List<Node>> nodesCache = new WeakHashMap<String, List<Node>>();
+
     public void setProperty(Map<String, Object> context, Object action, String paramName, Object paramValue) {
         try {
             OgnlContext ognlContext = new OgnlContext(context);
 
-            XWorkParameterParser parser = new XWorkParameterParser(paramName);
-            List<Node> nodes = parser.expression();
+            List<Node> nodes = nodesCache.get(paramName);
+            if (nodes == null) {
+                XWorkParameterParser parser = new XWorkParameterParser(paramName);
+                nodes = parser.expression();
+                nodesCache.put(paramName, nodes);
+            }
 
             Object lastObject = action;
             Object lastProperty = null;