Make matcher fields static final constants
MSALInstance fields of recipes and visitors holding a MethodMatcher, AnnotationMatcher or TypeMatcher built only from constants are recreated, and their pattern parsed again, for every instance. Make such private final fields private static final constants with an upper snake case name.
org. openrewrite. java. recipes. StaticFinalMatcherFieldsmod run . --recipe= org. openrewrite. java. recipes. StaticFinalMatcherFieldsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.