Adopt switch pattern matching (JEP 441)

MSAL

JEP 441 describes how some switch statements can be improved with pattern matching. This recipe applies some of those improvements where applicable.

org.openrewrite.java.migrate.SwitchPatternMatching
mod run . --recipe=org.openrewrite.java.migrate.SwitchPatternMatching

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

Recipe list

It runs these recipes, in this order.

  1. Use switch cases refinement when possible
  2. Use switch cases labels for enums