[
https://issues.apache.org/jira/browse/CAMEL-24771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Work on CAMEL-24771 started by Claus Ibsen.
-------------------------------------------
> 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
>
> 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)