Inline nested visitor classes into the returning method
MSALRecipes that return a named, private, static nested visitor class straight from getVisitor() (or getScanner()) can declare that visitor anonymously instead, which keeps the visitor next to the recipe metadata that configures it. Any private static final constants the nested class declares are hoisted onto the recipe class, as anonymous classes can not declare them. Only applied when the nested class is used exactly once, and when nothing would be lost by inlining it.
org. openrewrite. java. recipes. InlineNestedVisitorClassmod run . --recipe= org. openrewrite. java. recipes. InlineNestedVisitorClassInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.