gnodet opened a new pull request, #24491: URL: https://github.com/apache/camel/pull/24491
## Summary Fix remaining SonarCloud [S2095](https://sonarcloud.io/project/issues?id=apache_camel&rules=java:S2095&open=true) resource leaks not covered by PR #24358: - **JfrMemoryLeakDevConsole**: In `doStart()`, if an exception occurs after creating a `Recording` but before it is stored in the `activeRecording` field, the `Recording` leaks. Fixed by moving the `Recording` creation outside the `try` block and adding `rec.close()` in the `catch` block. - **LRAClient**: The `close()` method was empty despite holding an `HttpClient` field. Added proper cleanup using the `instanceof AutoCloseable` pattern (same approach used in PR #24358 for other `CloseableHttpClient` wrappers). This is forward-compatible with Java 21+ where `HttpClient` natively implements `AutoCloseable`. **Note:** The 20 `HttpClient`-related S2095 issues still shown as open in SonarCloud (in `OpenAIMock*Test`, `QdrantInfraService`, `UpdateCamelReleasesMojo`) were already fixed by merged PR #24358. They will clear from SonarCloud on the next re-scan of `main`. ## Test plan - [x] `mvn compile` passes for `core/camel-console` and `components/camel-lra` - [x] `mvn formatter:format impsort:sort` applied - [ ] CI build passes _Claude Code on behalf of gnodet_ Co-Authored-By: Claude Opus 4.6 <[email protected]> -- 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]
