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 4B9B3117E6 for ; Fri, 27 Jun 2014 11:23:44 +0000 (UTC) Received: (qmail 99782 invoked by uid 500); 27 Jun 2014 11:23:41 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 99683 invoked by uid 500); 27 Jun 2014 11:23:41 -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 99618 invoked by uid 99); 27 Jun 2014 11:23:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2014 11:23:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 26A6798D6EC; Fri, 27 Jun 2014 11:23:40 +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 Date: Fri, 27 Jun 2014 11:24:17 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [49/50] git commit: WW-4146 caches only valid OGNL expressions, closes #12 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/feature/WW-4295-localization 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; }