Find Thread.sleep(...) calls while holding a monitor

Proprietary

Finds Thread.sleep(...) calls whose nearest enclosing frame is a synchronized (...) block or a synchronized method. Sleeping while holding a monitor keeps every other thread that needs the same lock blocked until the sleep completes; Object.wait(...) releases the monitor for the duration and reacquires it on return.

org.openrewrite.java.security.search.FindThreadSleepInSynchronized
mod run . --recipe=org.openrewrite.java.security.search.FindThreadSleepInSynchronized

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.