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

   # Description
   
   Fixes [CAMEL-27390](https://issues.apache.org/jira/browse/CAMEL-27390).
   
   ## Summary
   
   A build on Windows wrote `ModelWriter.java` of camel-xml-io with 
`onFallback` before the outputs of the circuit breaker. 
`ModelWriterGeneratorMojo.postGenerateWriter` split the generated source with 
`System.lineSeparator()`, but the source has the LF line ends of the template. 
The method now splits at LF or CRLF and joins with LF, which gives the same 
file on every platform.
   
   - On Linux and macOS the generated `ModelWriter.java` stays as it is, so no 
generated file changes.
   - Only `XmlModelWriterGeneratorMojo` calls the method.
   
   ### Why the method joins with LF
   
   The committed `ModelWriter.java` has LF line ends. For a source with CRLF 
line ends, the old method kept CRLF. The second test covers that case.
   
   ## Tests
   
   - `ModelWriterGeneratorMojoTest` checks that `postGenerateWriter` moves the 
`onFallback` line below the outputs line for a source with LF line ends.
   - It checks that a source with CRLF line ends gives the same result.
   - Both tests failed before the change on Windows, and all 157 unit tests of 
the module pass now.
   - On Windows, a build of `core/camel-xml-io` changed `ModelWriter.java` 
before the change and leaves it unchanged now.
   
   # 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 ran `mvn clean install -Dquickly -DskipTests` in the root folder on 
the parent commit, b1919763fb4b. Then I ran `mvn install -nsu -DskipITs` in the 
plugin module and `mvn install -DskipTests -nsu` in `core/camel-xml-io`.
   
   # 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.
   
   Claude Code (Anthropic) drafted the change and this text, and ran the builds 
and tests named above.
   
   _Claude Code on behalf of saravanakumar1987_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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