Convert assigning switch statements to switch expressions
MSALSwitch 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. SwitchCaseAssignmentsToSwitchExpressionmod run . --recipe= org. openrewrite. java. migrate. lang. SwitchCaseAssignmentsToSwitchExpressionInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.