Use Reader.of(CharSequence) for non-synchronized readers

MSAL

Migrate new StringReader(String) to Reader.of(CharSequence) in Java 25+. This only applies when assigning to Reader variables or returning from methods that return Reader. The new method creates non-synchronized readers which are more efficient when thread-safety is not required.

org.openrewrite.java.migrate.util.MigrateStringReaderToReaderOf
mod run . --recipe=org.openrewrite.java.migrate.util.MigrateStringReaderToReaderOf

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