atiaomar1978-hub opened a new pull request, #25449: URL: https://github.com/apache/camel/pull/25449
# Description Fixes https://issues.apache.org/jira/browse/CAMEL-24376 Simple language boolean-zen shorthand (standalone `${header.foo}` / `${exchangeProperty.foo}` as implicit boolean predicates) fails when combined with logical operators `||` / `&&`. Example that previously threw `SimpleIllegalSyntaxException`: ``` ${bean:sessionTokenManager.getSessionToken} == null || ${exchangeProperty.forceNewSessionToken} ``` Workaround was to write `${exchangeProperty.forceNewSessionToken} == true` on the RHS. **Root cause:** `LogicalExpression.acceptLeftNode()` / `acceptRightNode()` only accepted `BinaryExpression` and `LogicalExpression`, rejecting `SimpleFunctionStart` used by boolean zen. **Fix:** - Accept `SimpleFunctionStart` as a valid logical operand (alongside existing binary/logical nodes) - Wrap boolean-zen operands in csimple codegen with `matchesValue(exchange, …)` so generated Java uses valid boolean expressions **Tests:** - Extended `SimplePredicateParserLogicalTest` with CAMEL-24376 scenarios - Added `CSimplePredicateParserTest.testParseBooleanZenLogicalOr` # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. _AI-generated PR description on behalf of atiaomar1978-hub (Cursor Cloud Agent)_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
