You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/06/18 10:33:32 UTC
git commit: WW-4146 caches only valid OGNL expressions, closes #12
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 <lu...@apache.org>
Authored: Wed Jun 18 10:33:21 2014 +0200
Committer: Lukasz Lenart <lu...@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;
}