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

   ## Summary
   
   Fix 7 SonarCloud blocker issues across 3 rules:
   
   ### S2276 — `wait()` should be used instead of `Thread.sleep()` when a lock 
is held (2 issues)
   - **File:** 
`core/camel-console/src/main/java/org/apache/camel/impl/console/JfrMemoryLeakDevConsole.java`
   - **Lines:** 140, 205
   - Replaced `Thread.sleep(500)` with `wait(500)` in synchronized methods 
`doStart()` and `doStopRecordingAndParse()`. The `wait()` call releases the 
monitor during the pause, allowing other threads to enter the synchronized 
block. Wrapped in a `while` loop with a deadline check to guard against 
spurious wakeups.
   
   ### S128 — Switch cases should end with an unconditional break, return, or 
throw (1 issue)
   - **File:** 
`dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java`
   - **Line:** 173
   - Added `break;` statement at the end of the multi-label case block to 
prevent fall-through to the `default` case.
   
   ### S3014 — Remove use of `ThreadGroup` (4 issues)
   - **File:** 
`tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java`
   - **Lines:** 462, 487, 519, 585
   - Refactored `IsolatedThreadGroup` from extending `ThreadGroup` to using 
composition with `Thread.UncaughtExceptionHandler`. ThreadGroup is encapsulated 
internally (with `@SuppressWarnings`) for thread containment since Java 17 has 
no modern alternative for thread enumeration by group. Moved 
`getActiveThreads()` logic into the wrapper class and updated 
`joinNonDaemonThreads()` and `terminateThreads()` method signatures.
   
   ## Test plan
   
   - [x] `core/camel-console` — 134 tests pass
   - [x] `dsl/camel-xml-io-dsl` — 62 tests pass
   - [x] `tooling/maven/camel-maven-plugin` — builds successfully (no test 
sources)
   
   _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