This is an automated email from the ASF dual-hosted git repository. kusal pushed a commit to branch WW-5340-ognlutil-refactor in repository https://gitbox.apache.org/repos/asf/struts.git
commit 13f0591ca1c3175932ad9fcc7d3374e0f2819308 Author: Kusal Kithul-Godage <g...@kusal.io> AuthorDate: Thu Aug 31 17:22:48 2023 +1000 WW-5340 Remove redundant check on #setValue --- core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java | 2 +- core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java index beee54cb4..f960fe73a 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java @@ -539,7 +539,7 @@ public class OgnlUtil { * @throws OgnlException in case of ognl errors */ public void setValue(final String name, final Map<String, Object> context, final Object root, final Object value) throws OgnlException { - ognlSet(name, context, root, value, context, this::checkEnableEvalExpression, this::checkEvalExpression, this::checkArithmeticExpression); + ognlSet(name, context, root, value, context, this::checkEvalExpression, this::checkArithmeticExpression); } private boolean isEvalExpression(Object tree, Map<String, Object> context) throws OgnlException { diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java index 0cafd799b..559677e99 100644 --- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java @@ -1312,7 +1312,7 @@ public class OgnlUtilTest extends XWorkTestCase { } assertNotNull(expected); assertSame(OgnlException.class, expected.getClass()); - assertEquals(expected.getMessage(), "Eval expressions/chained expressions have been disabled!"); + assertEquals("Eval expression/chained expressions cannot be used as parameter name", expected.getMessage()); } public void testCallMethod() {