ammachado opened a new pull request, #24119: URL: https://github.com/apache/camel/pull/24119
# Description `SimpleTokenizer` contained three private static methods (`evalBinary`, `evalOther`, `evalTernary`) with byte-for-byte identical bodies. This commit extracts the shared logic into a single `evalSurroundedBySpace` helper and makes each method delegate to it. The change is a pure behavior-preserving refactor: all three methods enforced the same invariant (the operator must appear surrounded by spaces: `"exp1 op exp2"`), so collapsing them removes duplication and makes future changes to the space-check logic a single-site edit. A new `SimpleTokenizerTest` covers all three operator classes (binary, other, ternary) plus boundary cases (operator at index 0, operator without trailing space). 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]
