Claus Ibsen created CAMEL-25954:
-----------------------------------

             Summary: camel-core-languages - Simple: a predicate inside ${ } is 
split at an operator inside brackets or parentheses, and the error quotes text 
that was never written
                 Key: CAMEL-25954
                 URL: https://issues.apache.org/jira/browse/CAMEL-25954
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 4.24.0


A predicate written inside $\{ \}, or the condition of a ternary there, is 
split at its first operator so that its function references can be wrapped 
(CAMEL-24920). The scan for that operator skips quotes, but not brackets and 
parentheses, so an operator in an index or an argument splits the text in the 
wrong place.

>From the local-model benchmark of Oct 21-22 2026, a model wrote:
{code}
${body.?[qty < 1].size() > 0 ? 'not enough' : 'reserved'}
{code}
The error quoted text the model never wrote, with a closing brace after qty:
{code}
expected symbol whiteSpace but was character: operators and values must be 
separated by a space at location 17
${body.?[qty} < 1].size() > 0
                 *
{code}
The same split happens for an operator in an argument, such as $\{iif(header.a 
> 0 && header.b > 0, 'x', 'y')\} (at the && and at the >).

Fix: SimpleSyntaxHints.wrapFunctions takes an operator (and a logical && or ||) 
only outside quotes, brackets and parentheses. The error then quotes the 
expression as written.

_Filed by Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to