Enum values should be compared with ==
MSALReplaces 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. CompareEnumsWithEqualityOperatormod run . --recipe= org. openrewrite. staticanalysis. CompareEnumsWithEqualityOperatorInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.