classpath
[Top][All Lists]
Advanced

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

java.lang.reflect.Constructor.newInstance


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
Class.java:

       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.

Thanks,

--Steve Augart

-- 
Steven Augart

Jikes RVM, a free, open source, Virtual Machine:
http://oss.software.ibm.com/jikesrvm




reply via email to

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