Prefer Objects.requireNonNull(T, Supplier<String>)
MSALReplace 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. NoGuavaPreconditionsCheckNotNullFormatmod run . --recipe= org. openrewrite. java. migrate. guava. NoGuavaPreconditionsCheckNotNullFormatInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.