You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/09/16 11:33:00 UTC
[jira] [Commented] (CAMEL-24771) camel-core - simple predicate fails to parse a } inside a quoted literal
[ https://issues.apache.org/jira/browse/CAMEL-24771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115991#comment-18115991 ]
Claus Ibsen commented on CAMEL-24771:
-------------------------------------
Fixed in https://github.com/apache/camel/pull/26509 (commit 742b30f85229).
_Claude Code on behalf of davsclaus_
> camel-core - simple predicate fails to parse a } inside a quoted literal
> ------------------------------------------------------------------------
>
> Key: CAMEL-24771
> URL: https://issues.apache.org/jira/browse/CAMEL-24771
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.23.0
>
>
> A simple *predicate* with a closing brace inside a quoted literal does not parse:
> {code}
> ${body} contains '}'
> ${body} contains '{name:XOrder}'
> ${body} == "[]}"
> {code}
> fails with {{singleQuote has no matching start token}} (or {{doubleQuote ...}}), while the same text as an expression parses fine. The validator page of the user manual uses {{${body} contains '{name:XOrder}'}} as its example, so a user copying it hits this.
> Cause: {{SimplePredicateParser.createNode}} turns every {{}}} token into a {{SimpleFunctionEnd}}, whether or not a function is open, so the {{}}} inside the quotes closes nothing and unbalances the quote pairing. {{SimpleExpressionParser}} only accepts a function end while a function is open ({{functions.get() > 0}}). The predicate parser also tracked the open function as a boolean, which is why the fix needs a depth counter: nested functions such as {{${body[x].get(${exchangeProperty[i]})[y]} == 1}} must keep balancing.
> Found while validating the documentation examples (CAMEL-24770).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)