The new ExplicitArrayForVarargs check is too strict: sometimes you need to invoke the vararg method with an array of size 0 in order to select the correct method (in case the vararg method is also overloaded).
Example:
CommentBuilder() { // some tools like Mockito or Hibernate require a no-arg constructor
this(new String[0]);
}
protected CommentBuilder(final String... prefixesToRemove) {
prefixes = Arrays.asList(prefixesToRemove);
}
For this code the new rule suggests:
Avoid explicit array creation for varargs
(see https://errorprone.info/bugpattern/ExplicitArrayForVarargs)
Did you mean 'this();'?
Which obviously is wrong.