This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Class.newInstance()


newInstance() was throwing the wrong exception when the class being instantiated has no null constructor. I'm checking this in.

Regards

Bryce.

2003-11-04 Bryce McKinlay <bryce@mckinlay.net.nz>

* java/lang/natClass.cc (newInstance): Throw InstantiationException
if class has no null-argument constructor.


--- natClass.cc 28 Oct 2003 22:45:57 -0000      1.71
+++ natClass.cc 4 Nov 2003 05:21:56 -0000
@@ -688,7 +688,7 @@

_Jv_Method *meth = _Jv_GetMethodLocal (this, init_name, void_signature);
if (! meth)
- throw new java::lang::NoSuchMethodException (_Jv_NewStringUtf8Const (init_name));
+ throw new java::lang::InstantiationException (getName());


   jobject r = JvAllocObject (this);
   ((void (*) (jobject)) meth->ncode) (r);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]