Repository: struts Updated Branches: refs/heads/develop dddb273b1 -> 519aefdc8 refs/heads/feature/exclude-object-class 5d8aa8a80 -> ee3c8d563
Extends patterns with parenthesis during initialisation Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/53fb5ba5 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/53fb5ba5 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/53fb5ba5 Branch: refs/heads/feature/exclude-object-class Commit: 53fb5ba5f89c641a92a4f7bee7584e7764741572 Parents: 5d8aa8a Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Thu May 1 09:39:55 2014 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Thu May 1 09:39:55 2014 +0200 ---------------------------------------------------------------------- .../main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/53fb5ba5/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 81f9700..5e06977 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 @@ -89,7 +89,11 @@ public class OgnlUtil { @Inject(value = XWorkConstants.OGNL_EXCLUDED_PROPERTIES, required = false) public void setExcludedProperties(String commaDelimitedProperties) { - excludedProperties = TextParseUtil.commaDelimitedStringToSet(commaDelimitedProperties); + Set<String> props = TextParseUtil.commaDelimitedStringToSet(commaDelimitedProperties); + for (String prop : props) { + excludedProperties.add(prop); + excludedProperties.add(prop + "()"); + } } /** @@ -309,8 +313,7 @@ public class OgnlUtil { if (tree instanceof SimpleNode) { SimpleNode node = (SimpleNode) tree; for (String excludedPattern : excludedProperties) { - // TODO lukaszlenart: need a better way to check 'toString' and 'toString()' call - if (excludedPattern.equalsIgnoreCase(node.toString()) || (excludedPattern + "()").equalsIgnoreCase(node.toString())) { + if (excludedPattern.equalsIgnoreCase(node.toString())) { throw new OgnlException("Tree [" + (parent != null ? parent : tree) + "] trying access excluded pattern [" + excludedPattern + "]"); } for (int i = 0; i < node.jjtGetNumChildren(); i++) {