struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject git commit: WW-4146 caches only valid OGNL expressions, closes #12
Date Wed, 18 Jun 2014 08:33:32 GMT
Repository: struts
Updated Branches:
  refs/heads/develop 21ef4e348 -> 63de7730e


WW-4146 caches only valid OGNL expressions, closes #12


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/63de7730
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/63de7730
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/63de7730

Branch: refs/heads/develop
Commit: 63de7730ee2be146e90227ed067ed108f4a2a534
Parents: 21ef4e3
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Wed Jun 18 10:33:21 2014 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Wed Jun 18 10:33:21 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/63de7730/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
index b0345fc..63c45fe 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -331,17 +331,17 @@ public class OgnlUtil {
             if (tree == null) {
                 tree = Ognl.parseExpression(expression);
                 checkEnableEvalExpression(tree, context);
-                expressions.putIfAbsent(expression, tree);
             }
         } else {
             tree = Ognl.parseExpression(expression);
             checkEnableEvalExpression(tree, context);
         }
 
-
         final T exec = task.execute(tree);
-        if(enableExpressionCache)
+        // if cache is enabled and it's a valid expression, puts it in
+        if(enableExpressionCache) {
             expressions.putIfAbsent(expression, tree);
+        }
         return exec;
     }
 


Mime
View raw message