[Top][All Lists]

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


From: Steven Augart
Subject: java.lang.reflect.Constructor.newInstance
Date: Thu, 23 Sep 2004 12:37:18 -0400

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.  Does this
make sense to anyone?  I admit it's a nice optimization, but it seems
to me that we don't want to constrain the VM's reflection optimization
to support this.  If we want to use the same caching approach we do
with the zero-arg constructor in that function, we could also cache a
zero-length array of Object.


--Steve Augart

Steven Augart

Jikes RVM, a free, open source, Virtual Machine:

reply via email to

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