ammachado opened a new pull request, #24118:
URL: https://github.com/apache/camel/pull/24118

   # Description
   
   When the simple expression parser encounters an invalid right-hand side in a 
logical operator expression (`&&` / `||`), it was reporting the wrong token in 
the error message: it used `left.getToken()` instead of `right.getToken()`.
   
   This PR fixes the one-line bug and makes the error branch reachable by 
teaching `LogicalExpression.acceptLeftNode` and `acceptRightNode` to enforce 
that only `BinaryExpression` or `LogicalExpression` nodes are valid on either 
side of a logical operator. Previously both methods unconditionally returned 
`true`, so the error path was dead code and the wrong-token bug was 
unobservable.
   
   A new test (`SimplePredicateParserLogicalTest`) covers:
   - Happy-path `&&` and `||` combinations (7 tests)
   - A negative case that verifies the error message names the right-hand 
offending token, not the left-hand one (1 test)
   
   Discovered during the work on CAMEL-22894 (simple language parser hardening).
   
   _Claude Code on behalf of Adriano Machado_
   
   # 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.


-- 
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]

Reply via email to