Add null check to existing switch cases

MSAL

In later Java 21+, null checks are valid in switch cases. This recipe will only add null checks to existing switch cases if there are no other statements in between them or if the block in the if statement is not impacting the flow of the switch.

org.openrewrite.java.migrate.lang.NullCheckAsSwitchCase
mod run . --recipe=org.openrewrite.java.migrate.lang.NullCheckAsSwitchCase

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