This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 08eb15d9ce2 Revert "CAMEL-21600: camel-ognl - Workaround for ognl 
3.4.5 issue"
08eb15d9ce2 is described below

commit 08eb15d9ce29d15de69db292e291e7df9c934a1b
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Feb 24 16:50:16 2025 +0100

    Revert "CAMEL-21600: camel-ognl - Workaround for ognl 3.4.5 issue"
    
    This reverts commit 6f7d1686f01c505a96d1a9a479e826245db7cd22.
---
 .../apache/camel/language/ognl/OgnlExpression.java |  2 +-
 .../org/apache/camel/language/ognl/OgnlHelper.java | 37 ----------------------
 .../apache/camel/language/ognl/OgnlLanguage.java   |  2 +-
 3 files changed, 2 insertions(+), 39 deletions(-)

diff --git 
a/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlExpression.java
 
b/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlExpression.java
index 635477f4137..a359b87e961 100644
--- 
a/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlExpression.java
+++ 
b/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlExpression.java
@@ -54,7 +54,7 @@ public class OgnlExpression extends ExpressionSupport {
         RootObject root = new RootObject(exchange);
         OgnlContext oglContext = Ognl.createDefaultContext(root, cr);
         try {
-            Object value = OgnlHelper.getValue(expression, oglContext, root);
+            Object value = Ognl.getValue(expression, oglContext, root);
             return exchange.getContext().getTypeConverter().convertTo(tClass, 
value);
         } catch (OgnlException e) {
             throw new ExpressionEvaluationException(this, exchange, e);
diff --git 
a/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlHelper.java
 
b/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlHelper.java
deleted file mode 100644
index 2e991ce31fa..00000000000
--- 
a/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlHelper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.language.ognl;
-
-import ognl.Node;
-import ognl.OgnlContext;
-import ognl.OgnlException;
-
-public final class OgnlHelper {
-
-    private OgnlHelper() {
-    }
-
-    public static Object getValue(Object expression, OgnlContext ognlContext, 
Object root) throws OgnlException {
-        // workaround bug in ognl 3.4.5
-        Node node = (Node) expression;
-        if (node.getAccessor() != null) {
-            return node.getAccessor().get(ognlContext, root);
-        } else {
-            return node.getValue(ognlContext, root);
-        }
-    }
-}
diff --git 
a/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlLanguage.java
 
b/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlLanguage.java
index 10bcc3ebe52..0ceb31c9ca0 100644
--- 
a/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlLanguage.java
+++ 
b/components/camel-ognl/src/main/java/org/apache/camel/language/ognl/OgnlLanguage.java
@@ -52,7 +52,7 @@ public class OgnlLanguage extends TypedLanguageSupport 
implements ScriptingLangu
             Object compiled = Ognl.parseExpression(script);
             ClassResolver cr = new 
CamelClassResolver(getCamelContext().getClassResolver());
             OgnlContext oglContext = Ognl.createDefaultContext(null, cr);
-            Object value = OgnlHelper.getValue(compiled, oglContext, bindings);
+            Object value = Ognl.getValue(compiled, oglContext, bindings);
             return getCamelContext().getTypeConverter().convertTo(resultType, 
value);
         } catch (Exception e) {
             throw new ExpressionIllegalSyntaxException(script, e);

Reply via email to