You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ap...@apache.org on 2026/08/28 12:43:50 UTC

(camel) branch main updated: Cleanup after CSimple language removal

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

apupier 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 4179626e1c37 Cleanup after CSimple language removal
4179626e1c37 is described below

commit 4179626e1c371c86c4b0e6643a60f7732d55f0fb
Author: Aurélien Pupier <ap...@ibm.com>
AuthorDate: Fri Aug 28 10:09:47 2026 +0200

    Cleanup after CSimple language removal
    
    follow-up on https://github.com/apache/camel/pull/25807
    
    Signed-off-by: Aurélien Pupier <ap...@ibm.com>
---
 .../language/simple/SimpleFunctionHelper.java      | 107 ---------------------
 .../simple/ast/SimpleFunctionExpression.java       |   4 -
 .../modules/ROOT/pages/backlog-debugger.adoc       |   4 +-
 3 files changed, 2 insertions(+), 113 deletions(-)

diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleFunctionHelper.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleFunctionHelper.java
index 7e2037c7f8aa..ab78e630b7ce 100644
--- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleFunctionHelper.java
+++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleFunctionHelper.java
@@ -16,12 +16,6 @@
  */
 package org.apache.camel.language.simple;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.util.OgnlHelper;
-import org.apache.camel.util.StringHelper;
-
 public final class SimpleFunctionHelper {
 
     private SimpleFunctionHelper() {
@@ -37,107 +31,6 @@ public final class SimpleFunctionHelper {
         return null;
     }
 
-    public static List<String> splitOgnl(String remainder) {
-        List<String> methods = OgnlHelper.splitOgnl(remainder);
-        List<String> answer = new ArrayList<>();
-        for (String m : methods) {
-            if (m.startsWith(".")) {
-                m = m.substring(1);
-            }
-            boolean index = m.startsWith("[") && m.endsWith("]");
-            if (index) {
-                String last = answer.isEmpty() ? null : answer.get(answer.size() - 1);
-                boolean lastIndex = last != null && last.startsWith("[") && last.endsWith("]");
-                if (lastIndex) {
-                    answer.set(answer.size() - 1, last + m);
-                } else {
-                    answer.add(m);
-                }
-            } else {
-                answer.add(m);
-            }
-        }
-        return answer;
-    }
-
-    public static String ognlCodeMethods(String remainder, String type) {
-        StringBuilder sb = new StringBuilder(256);
-
-        if (remainder != null) {
-            List<String> methods = splitOgnl(remainder);
-            for (String m : methods) {
-                if (m.startsWith("(")) {
-                    sb.append(m);
-                    continue;
-                }
-
-                String index = StringHelper.betweenOuterPair(m, '[', ']');
-                if (index != null) {
-                    m = StringHelper.before(m, "[");
-                }
-
-                if (m != null && m.equals("length")) {
-                    if (type != null && type.contains("[]")) {
-                        sb.append(".length");
-                        continue;
-                    }
-                }
-
-                if (m != null) {
-                    m = OgnlHelper.methodAsDoubleQuotes(m);
-                }
-
-                if (m != null && !m.isEmpty()) {
-                    sb.append(".");
-                    char ch = m.charAt(m.length() - 1);
-                    if (Character.isAlphabetic(ch)) {
-                        if (!m.startsWith("get")) {
-                            sb.append("get");
-                            sb.append(Character.toUpperCase(m.charAt(0)));
-                            sb.append(m.substring(1));
-                        } else {
-                            sb.append(m);
-                        }
-                        sb.append("()");
-                    } else {
-                        sb.append(m);
-                    }
-                }
-
-                if (index != null) {
-                    sb.append(".get(");
-                    try {
-                        long lon = Long.parseLong(index);
-                        sb.append(lon);
-                        if (lon > Integer.MAX_VALUE) {
-                            sb.append("l");
-                        }
-                    } catch (Exception e) {
-                        index = StringHelper.removeLeadingAndEndingQuotes(index);
-                        sb.append("\"");
-                        sb.append(index);
-                        sb.append("\"");
-                    }
-                    sb.append(")");
-                }
-            }
-        }
-
-        if (!sb.isEmpty()) {
-            return sb.toString();
-        } else {
-            return remainder;
-        }
-    }
-
-    public static String appendClass(String type) {
-        type = StringHelper.removeQuotes(type);
-        if (!type.endsWith(".class")) {
-            type = type + ".class";
-        }
-        return type;
-    }
-
     public static String parseInHeader(String function) {
         String remainder;
         remainder = ifStartsWithReturnRemainder("in.headers", function);
diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java
index 6cd733b81667..9c36cfcd4093 100644
--- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java
+++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java
@@ -194,8 +194,4 @@ public class SimpleFunctionExpression extends LiteralExpression {
         return SimpleFunctionHelper.ifStartsWithReturnRemainder(prefix, text);
     }
 
-    @Deprecated(since = "4.21")
-    public static String ognlCodeMethods(String remainder, String type) {
-        return SimpleFunctionHelper.ognlCodeMethods(remainder, type);
-    }
 }
diff --git a/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc b/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc
index 146fd17954b4..c3de840c7e0e 100644
--- a/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc
+++ b/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc
@@ -43,8 +43,8 @@ NOTE: This requires to enabled JMX by including `camel-management` JAR in the cl
 |`dumpTracedMessagesAsXml(nodeId, boolean)` |`String` |To dump the debugged messages from the give node id in XML format, optionally including the exchange properties.
 |`enableBreakpoint(nodeId)` |`void` |To activate a breakpoint which has been disabled.
 |`enableDebugger` |`void` |To enable the debugger
-|`evaluateExpressionAtBreakpoint(nodeId, language, expression)` | `String`|To evaluate an expression in any supported language (e.g. Simple, etc.) and convert the result to String
-|`evaluateExpressionAtBreakpoint(nodeId, language, expression, resultType)` | `Object`|To evaluate an expression in any supported language (e.g. Simple, etc.) and return the result as a given result type
+|`evaluateExpressionAtBreakpoint(nodeId, language, expression)` | `String`|To evaluate an expression in any supported language (e.g. Simple) and convert the result to String
+|`evaluateExpressionAtBreakpoint(nodeId, language, expression, resultType)` | `Object`|To evaluate an expression in any supported language (e.g. Simple) and return the result as a given result type
 |`getBreakpoints` |`Set<String>` |To get a set of all the nodes which has a breakpoint added.
 |`getDebuggerCounter` |`long` |Gets the total number of debugged messages.
 |`getSuspendedBreakpointNodeIds` |`Set<String>` |To get a set of all the nodes which has suspended breakpoints (eg an Exchange at the breakpoint which is suspended).