Convert assigning switch statements to switch expressions

MSAL

Switch statements for which each case is assigning a value to the same variable can be converted to a switch expression that returns the value of the variable. This recipe is only applicable for Java 21 and later.

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

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