Use UsesMethod and DeclaresMethod preconditions with MethodMatchers
MSALPass an existing static final MethodMatcher field to UsesMethod and DeclaresMethod instead of repeating its method pattern and matchOverrides flag. Also replace new FindMethods(..).getVisitor() and new FindMethodDeclaration(..).getVisitor() preconditions with UsesMethod and DeclaresMethod, which only consult the types in use of a source file.
org. openrewrite. java. recipes. UseMethodMatcherPreconditionsmod run . --recipe= org. openrewrite. java. recipes. UseMethodMatcherPreconditionsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.