Add null check to existing switch cases
MSALIn 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. NullCheckAsSwitchCasemod run . --recipe= org. openrewrite. java. migrate. lang. NullCheckAsSwitchCaseInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.