OSDN Git Service

* java/lang/natClass.cc (newInstance): Throw InstantiationException
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Nov 2003 05:27:10 +0000 (05:27 +0000)
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Nov 2003 05:27:10 +0000 (05:27 +0000)
        if class has no null-argument constructor.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73244 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 799b490..6cbae87 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 155d1b9..f7793a5 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);