Prefer Objects.requireNonNull(T, Supplier<String>)

MSAL

Replace Guava's Preconditions.checkNotNull(reference, template, args..) with Objects.requireNonNull(reference, () -> String.format(template, args..)), which formats the message only when the reference is null, as Guava does. A template converts only when it is a string literal whose placeholders are all %s and match the arguments, and only when the lambda can capture every argument.

org.openrewrite.java.migrate.guava.NoGuavaPreconditionsCheckNotNullFormat
mod run . --recipe=org.openrewrite.java.migrate.guava.NoGuavaPreconditionsCheckNotNullFormat

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