Claus Ibsen created CAMEL-25080:
-----------------------------------
Summary: camel-bean - a comma inside a ${...} expression in the
method name parameters splits the parameter
Key: CAMEL-25080
URL: https://issues.apache.org/jira/browse/CAMEL-25080
Project: Camel
Issue Type: Bug
Components: camel-bean
Reporter: Claus Ibsen
The parameter values in the bean method name are split with
{{StringQuoteHelper.splitSafeQuote(methodParameters, ',', true, true)}}
(MethodInfo). It only treats commas inside single or double quotes as part of a
value. A comma inside a Simple expression {{${...}}} or inside nested
parentheses is taken as a parameter separator.
For example:
{code:java}
from("direct:start").bean(MyBean.class, "echo(${body.substring(0, 2)})");
{code}
The parameters are split into {{${body.substring(0}} and {{2)}}, so the
expression fails to parse (or the method is not matched), instead of passing
the first two characters of the body.
The split should not break a parameter inside {{${ }}} (and probably not inside
nested parentheses either). Found while working on CAMEL-25033 (PR #26908),
where a property-based test for this case still fails and was left for its own
change.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)