AtomicBoolean, AtomicInteger, and AtomicLong equality checks compare their values

MSAL

AtomicBoolean#equals(Object), AtomicInteger#equals(Object) and AtomicLong#equals(Object) are only equal to their instance. This recipe converts a.equals(b) to a.get() == b.get(). These atomic classes do not override equals from Object, so calling it compares object identity rather than the wrapped value, which is almost never the intended behavior.

org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet
mod run . --recipe=org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet

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