natClass.cc (newInstance): Throw InstantiationException if class has no null-argument...
authorBryce McKinlay <bryce@mckinlay.net.nz>
Tue, 4 Nov 2003 05:27:10 +0000 (05:27 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Tue, 4 Nov 2003 05:27:10 +0000 (05:27 +0000)
        * java/lang/natClass.cc (newInstance): Throw InstantiationException
        if class has no null-argument constructor.

From-SVN: r73244

libjava/ChangeLog
libjava/java/lang/natClass.cc

index 799b490bf00df146edaf16d5f9511f755df61982..6cbae87531dbf484b384a8b2f4ff81a3fa4a0c0a 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-04  Bryce McKinlay  <bryce@mckinlay.net.nz>
+
+       * java/lang/natClass.cc (newInstance): Throw InstantiationException
+       if class has no null-argument constructor.
+
 2003-10-30  Mohan Embar  <gnustuff@thisiscool.com>
 
        PR libgcj/12647:
index 155d1b997df3cfe9f01283e188d612dc707ea9d6..f7793a56d56e862b700971242c93f9512e201351 100644 (file)
@@ -688,7 +688,7 @@ java::lang::Class::newInstance (void)
 
   _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);