Find LST elements converted to strings

MSAL

Find toString(), String.valueOf(..), Objects.toString(..), String.format(..), StringBuilder.append(..), PrintStream.println(..), string concatenation and method references such as Object::toString on org.openrewrite.Tree subtypes, and on collections of them, outside of tests. toString() prints the element without a cursor, so J elements print as Java also in Kotlin, Groovy or C# sources, and other trees print whatever their class happens to implement. Searching the printed text also matches comments and string literals, and misses differently spelled forms. Check the LST and its types instead, or call print(Cursor) when the source text itself is needed.

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

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