Pass the visitor's cursor to printTrimmed()

MSAL

Replace the deprecated J.printTrimmed() with printTrimmed(getCursor()) inside a JavaVisitor written in Java, so that the tree prints with the printer of its source file's language, such as Kotlin or Groovy, rather than always as Java. A private static helper method of the visitor becomes an instance method, when only the visitor's own instance methods call it.

org.openrewrite.java.recipes.PrintTrimmedWithCursor
mod run . --recipe=org.openrewrite.java.recipes.PrintTrimmedWithCursor

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.