Return-Path: X-Original-To: apmail-struts-commits-archive@minotaur.apache.org Delivered-To: apmail-struts-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92D5611943 for ; Wed, 18 Jun 2014 08:33:42 +0000 (UTC) Received: (qmail 82460 invoked by uid 500); 18 Jun 2014 08:33:32 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 82417 invoked by uid 500); 18 Jun 2014 08:33:32 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 82408 invoked by uid 99); 18 Jun 2014 08:33:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2014 08:33:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1E93D83B5DC; Wed, 18 Jun 2014 08:33:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lukaszlenart@apache.org To: commits@struts.apache.org Message-Id: <6553fef6ec564a70af7bda956f1926a6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: WW-4146 caches only valid OGNL expressions, closes #12 Date: Wed, 18 Jun 2014 08:33:32 +0000 (UTC) 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 Authored: Wed Jun 18 10:33:21 2014 +0200 Committer: Lukasz Lenart 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; }