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

   # Description
   
   Continues the ongoing extraction of `SimpleFunctionExpression` inline logic 
into dedicated `SimpleLanguageFunctionFactory` implementations (CAMEL-22894).
   
   This PR extracts the OGNL/exchange-property group into a new 
`ExchangeFunctionFactory`, covering:
   
   - `${camelContext.OGNL}` — CamelContext OGNL navigation
   - `${exception.OGNL}` — exception OGNL navigation
   - `${exceptionAs(type).OGNL}` — typed exception cast with optional OGNL 
(CSimple code-gen only)
   - `${exchangeProperty.name}`, `${exchangeProperty:name}`, 
`${exchangeProperty[name]}` — plain property access
   - `${exchangePropertyAs(key, type)}` — typed property access (CSimple 
code-gen only)
   - `${exchangePropertyAsIndex(key, type, index)}` — indexed typed property 
access (CSimple code-gen only)
   - `${exchange.OGNL}` — raw Exchange OGNL navigation
   
   All parsing and error messages are preserved exactly from the removed inline 
blocks. Prefix ordering within the factory is intentional: 
`exchangePropertyAsIndex(` before `exchangePropertyAs(` before 
`exchangeProperty`; `exceptionAs(` before `exception`; `exchangeProperty` 
before `exchange`.
   
   `SimpleFunctionExpression` drops from ~560 to 333 lines after this 
extraction.
   
   A post-review fix was also applied: the `exception` OGNL invalid-OGNL error 
message in `createCode` was incorrectly saying `${exceptionAs(type).OGNL}` 
instead of `${exception.OGNL}` (copy-paste from the branch above it). A 
`createCode` invalid-OGNL test was added to catch this class of regression.
   
   _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