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 14d343503 WW-5340 Rename functional interface
14d343503 is described below

commit 14d34350358e8bc583d70a894ec41ea97058d740
Author: Kusal Kithul-Godage <g...@kusal.io>
AuthorDate: Thu Aug 31 17:26:45 2023 +1000

    WW-5340 Rename functional interface
---
 .../main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 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 f960fe73a..e1df852e3 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -597,18 +597,18 @@ public class OgnlUtil {
         return compile(expression, null);
     }
 
-    private void ognlSet(String expr, Map<String, Object> context, Object 
root, Object value, Map<String, Object> checkContext, TreeCheck ...treeChecks) 
throws OgnlException {
+    private void ognlSet(String expr, Map<String, Object> context, Object 
root, Object value, Map<String, Object> checkContext, TreeValidator... 
treeValidators) throws OgnlException {
         Object tree = toTree(expr);
-        for (TreeCheck check : treeChecks) {
-            check.consume(tree, checkContext);
+        for (TreeValidator check : treeValidators) {
+            check.validate(tree, checkContext);
         }
         Ognl.setValue(tree, context, root, value);
     }
 
-    private <T> T ognlGet(String expr, Map<String, Object> context, Object 
root, Class<T> resultType, Map<String, Object> checkContext, TreeCheck 
...treeChecks) throws OgnlException {
+    private <T> T ognlGet(String expr, Map<String, Object> context, Object 
root, Class<T> resultType, Map<String, Object> checkContext, TreeValidator... 
treeValidators) throws OgnlException {
         Object tree = toTree(expr);
-        for (TreeCheck check : treeChecks) {
-            check.consume(tree, checkContext);
+        for (TreeValidator check : treeValidators) {
+            check.validate(tree, checkContext);
         }
         return (T) Ognl.getValue(tree, context, root, resultType);
     }
@@ -895,7 +895,7 @@ public class OgnlUtil {
     }
 
     @FunctionalInterface
-    private interface TreeCheck {
-        void consume(Object tree, Map<String, Object> context) throws 
OgnlException;
+    private interface TreeValidator {
+        void validate(Object tree, Map<String, Object> context) throws 
OgnlException;
     }
 }

Reply via email to