Use AtomicBoolean#weakCompareAndSetPlain(boolean, boolean)

MSAL

Use AtomicBoolean#weakCompareAndSetPlain(boolean, boolean) instead of the deprecated AtomicBoolean#weakCompareAndSet(boolean, boolean) in Java 9 or higher.

org.openrewrite.java.migrate.concurrent.MigrateAtomicBooleanWeakCompareAndSetToWeakCompareAndSetPlain
mod run . --recipe=org.openrewrite.java.migrate.concurrent.MigrateAtomicBooleanWeakCompareAndSetToWeakCompareAndSetPlain

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

Recipe list

It runs these recipes, in this order.

  1. Change method name java.util.concurrent.atomic.AtomicBoolean weakCompareAndSet(boolean, boolean) to weakCompareAndSetPlain