Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Java compiler checks the type -checks of the arguments to each variable arity (varargs) method to ensure that the arguments are of the same type or object reference. However, the compile-time checking is ineffective when Object or generic parameter types are used [Bloch 2008]. The presence of initial parameters of specific types is irrelevant; the compiler will remain unable to check Object or generic variable arity parameter types. Enable strong compile-time type checking of variable arity methods by using the most specific type possible for the type of the method parameter.

...