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

   ## Summary
   
   Fix 3 `clone()` methods that don't call `super.clone()`, addressing 
SonarCloud rule 
[java:S2975](https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&rules=java%3AS2975&id=apache_camel).
   
   ### Changes
   
   | File | Fix |
   |---|---|
   | `MiloClientConfiguration` | Replace `new MiloClientConfiguration(this)` 
with `super.clone()` + deep copy of mutable `allowedSecurityPolicies` Set |
   | `ThreadPoolProfile` | Replace manual field-by-field copy with 
`super.clone()` (all fields are immutable primitives/wrappers/enums/String) |
   | `DefaultLineBuilderStrategy.LineBuilder` | Rename `clone()` to `copy()` 
since this private inner class doesn't implement `Cloneable` |
   
   ### Note on the remaining 7 SonarCloud S2975 issues
   
   SonarCloud S2975 fires on **any** `clone()` override, not just those missing 
`super.clone()`. The remaining 7 flagged files (`Transcribe2Configuration`, 5× 
Infinispan configs, `ComponentModel.ApiOptionModel`) already call 
`super.clone()` correctly. The rule recommends removing `clone()` entirely in 
favor of copy constructors, but these are part of the public API and used by 
Camel components for configuration cloning — removing them would be a breaking 
change.
   
   ## Test plan
   
   - [x] `mvn test` passes in `core/camel-api`
   - [x] `mvn test` passes in `components/camel-milo` (43 tests, 0 failures)
   - [x] `mvn test` passes in `components/camel-pdf` (10 tests, 0 failures)
   - [x] `mvn formatter:format impsort:sort` applied on all 3 modules
   
   _Claude Code on behalf of gnodet_
   
   🤖 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