This check ensures that the number of arguments passed to ‘lenient’ formatting
methods like Preconditions.checkArgument
match the number of format
specifiers.
WARNING: Only the exact two-character placeholder sequence %s
is recognized by
these methods. Any others will be ignored, and not used for argument
substitution.
The APIs checked by this bugpattern include:
com.google.common.base.Strings#lenientFormat
com.google.common.base.Preconditions#check*
com.google.common.base.Verify#verify*
com.google.common.truth.Truth#assertWithMessage
com.google.common.truth.Subject#check
com.google.common.truth.StandardSubjectBuilder#withMessage
Suppress false positives by adding the suppression annotation @SuppressWarnings("LenientFormatStringValidation")
to the enclosing element.