Use J.Case.getCaseLabels()
MSALReplace the deprecated J.Case.getPattern() with getCaseLabels().get(0) where its result is checked with instanceof, cast, or passed as an Object, and the deprecated J.Case.getExpressions() with getCaseLabels() where its stream is searched with anyMatch or noneMatch for a type of Expression. The deprecated methods leave out the type patterns that getCaseLabels() includes, so other calls are left alone.
org. openrewrite. java. recipes. UseCaseLabelsmod run . --recipe= org. openrewrite. java. recipes. UseCaseLabelsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.