[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: java.lang.reflect.Constructor.newInstance

From: David Holmes
Subject: RE: java.lang.reflect.Constructor.newInstance
Date: Fri, 24 Sep 2004 09:57:58 +1000

> Steven Augart writes:
> I am wondering whether we want to rely upon
> java.lang.reflect.Constructor.newInstance supporting undocumented
> behavior.  Specifically,  I found this line in our version of
>        return constructor.newInstance(null);
> This strikes me as relying on Constructor.newinstance(Object[])
> accepting  null in place of a zero-length array of Object.

This is specified behaviour as of 1.4:

"If the number of formal parameters required by the underlying constructor
is 0, the supplied initargs array may be of length 0 or null. "

David Holmes

reply via email to

[Prev in Thread] Current Thread [Next in Thread]