Prefer String.formatted(Object...)

MSAL

Prefer String.formatted(Object...) over String.format(String, Object...) in Java 17 or higher.

org.openrewrite.java.migrate.lang.StringFormatted

Optional

addParenthesesBoolean

Add parentheses around the first argument if it is not a simple expression. Default true; if false, calls whose first argument would need parentheses are left unchanged.

mod run . --recipe=org.openrewrite.java.migrate.lang.StringFormatted

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