ammachado opened a new pull request, #24120: URL: https://github.com/apache/camel/pull/24120
# Description `SimpleExpressionParser` and `SimplePredicateParser` used `AtomicBoolean` and `AtomicInteger` solely as mutable holders to capture state inside lambda expressions. Since both parsers are single-threaded, using `Atomic*` types is semantically misleading (it implies concurrent access) and carries unnecessary overhead. This commit replaces them with single-element `boolean[]` and `int[]` arrays, which are the standard Java idiom for capturing mutable state in a lambda without implying thread safety. A new `SimpleParserMutableStateTest` covers the state-tracking paths in both parsers: balanced/unbalanced single quotes, balanced/unbalanced function blocks, and compound predicate expressions. 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]
