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
The following commit(s) were added to refs/heads/WW-5340-ognlutil-refactor by this push: new 90adbfb3c WW-5340 Fix OgnlReflectionProvider bypassing OgnlUtil 90adbfb3c is described below commit 90adbfb3cee53cc4284d3155a8a95009a8b35f55 Author: Kusal Kithul-Godage <g...@kusal.io> AuthorDate: Thu Aug 31 18:58:56 2023 +1000 WW-5340 Fix OgnlReflectionProvider bypassing OgnlUtil --- .../java/com/opensymphony/xwork2/ognl/OgnlReflectionProvider.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlReflectionProvider.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlReflectionProvider.java index d21b2f624..1dbc8c67e 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlReflectionProvider.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlReflectionProvider.java @@ -21,7 +21,6 @@ package com.opensymphony.xwork2.ognl; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.reflection.ReflectionException; import com.opensymphony.xwork2.util.reflection.ReflectionProvider; -import ognl.Ognl; import ognl.OgnlException; import ognl.OgnlRuntime; @@ -33,9 +32,9 @@ import java.util.Collection; import java.util.Map; public class OgnlReflectionProvider implements ReflectionProvider { - + private OgnlUtil ognlUtil; - + @Inject public void setOgnlUtil(OgnlUtil ognlUtil) { this.ognlUtil = ognlUtil; @@ -69,7 +68,6 @@ public class OgnlReflectionProvider implements ReflectionProvider { public void setProperties(Map<String, ?> props, Object o, Map<String, Object> context, boolean throwPropertyExceptions) throws ReflectionException{ ognlUtil.setProperties(props, o, context, throwPropertyExceptions); - } public void setProperties(Map<String, ?> properties, Object o) { @@ -134,7 +132,7 @@ public class OgnlReflectionProvider implements ReflectionProvider { public void setValue(String expression, Map<String, Object> context, Object root, Object value) throws ReflectionException { try { - Ognl.setValue(expression, context, root, value); + ognlUtil.setValue(expression, context, root, value); } catch (OgnlException e) { throw new ReflectionException(e); }