Enum values should be compared with ==

MSAL

Replaces a.equals(b) with a == b when a is an enum, and !a.equals(b) with a != b. Using == for enum comparison is null-safe, catches type mismatches at compile time, and is idiomatic since each enum constant is guaranteed to be a singleton.

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

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