Use AtomicReferenceArray#weakCompareAndSetPlain(int, T, T)

MSAL

Use AtomicReferenceArray#weakCompareAndSetPlain(int, T, T) instead of the deprecated AtomicReferenceArray#weakCompareAndSet(int, T, T) in Java 9 or higher.

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

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.AtomicReferenceArray weakCompareAndSet(int, ..) to weakCompareAndSetPlain