Find Thread.sleep(...) calls while holding a monitor
ProprietaryFinds 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. FindThreadSleepInSynchronizedmod run . --recipe= org. openrewrite. java. security. search. FindThreadSleepInSynchronizedInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.