Use Collections#emptyList(), emptyMap(), and emptySet()
MSALReplaces Collections#EMPTY_... with methods that return generic types. The raw-typed constant fields bypass generics checks, which can hide type mismatches that only surface as ClassCastException at runtime.
org. openrewrite. staticanalysis. NoEmptyCollectionWithRawTypemod run . --recipe= org. openrewrite. staticanalysis. NoEmptyCollectionWithRawTypeInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.