DistinctVarargsChecker
Method expects distinct arguments at some/all positions

Severity
WARNING

The problem

Various methods which take variable-length arguments throw the runtime exceptions like IllegalArgumentException when the arguments are not distinct.

This checker warns on using the non-distinct parameters in various varargs method when the usage is redundant or will either result in the runtime exception.

Bad:

ImmutableSet.of(first, second, second, third);

Good:

ImmutableSet.of(first, second, third);

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("DistinctVarargsChecker") to the enclosing element.