PROPOSAL: Simplified Varargs Method Invocation

Reinier Zwitserloot reinier at
Fri Mar 6 11:20:02 PST 2009


good find. It turns out that you can use varargs to invoke a method  
with signature:

public void methodName(Foobar[] x) {}

*IF* any supertype of the type containing this method has the same  
method with varargs. I assume that's why the warning was removed. This  
magic varargs behaviour is present in both javac 1.5 and javac 1.6.

  --Reinier Zwitserloot

On Mar 6, 2009, at 17:55, Mark Mahieu wrote:

> Reinier,
> On 6 Mar 2009, at 14:58, Reinier Zwitserloot wrote:
>> The plot thickens. Javac v1.5 WILL warn you when you de-varargs a
>> superclass. However, any javac v1.6 will NOT. Evidently one of the
>> javac engineers had a reason to remove the warning. That reason would
>> probably be very pertinent to this discussion. Anyone familiar enough
>> with mercurial to dig the comment on this changeset out of the  
>> javac's
>> repository?
> is this what you're looking for?
> Regards,
> Mark

More information about the coin-dev mailing list