]> gcc.gnu.org Git - gcc.git/commitdiff
natConstructor.cc (newInstance): Initialize class.
authorTom Tromey <tromey@redhat.com>
Tue, 27 Aug 2002 23:57:17 +0000 (23:57 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Tue, 27 Aug 2002 23:57:17 +0000 (23:57 +0000)
* java/lang/reflect/natConstructor.cc (newInstance): Initialize
class.
* java/lang/reflect/natMethod.cc (invoke): Initialize class.

From-SVN: r56624

libjava/ChangeLog
libjava/java/lang/reflect/natConstructor.cc
libjava/java/lang/reflect/natMethod.cc

index f4001489d427e7e4c38cbdeccc1bb4562a564105..9ae3d6a66333768bf2757682cd428ee6656c2408 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-27  Tom Tromey  <tromey@redhat.com>
+
+       * java/lang/reflect/natConstructor.cc (newInstance): Initialize
+       class.
+       * java/lang/reflect/natMethod.cc (invoke): Initialize class.
+
 2002-08-27  Michael Koch <konqueror@gmx.de>
 
        * java/net/BindException.java,
index 1103d777bf7b84b9866fce040deb2f5c61f16793..7f90b1243e4aafbb982c52a3925c5070f7e033e5 100644 (file)
@@ -1,6 +1,6 @@
 // natConstructor.cc - Native code for Constructor class.
 
-/* Copyright (C) 1999, 2000, 2001  Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -50,6 +50,8 @@ java::lang::reflect::Constructor::newInstance (jobjectArray args)
   if (Modifier::isAbstract (declaringClass->getModifiers()))
     throw new InstantiationException;
 
+  _Jv_InitClass (declaringClass);
+
   jmethodID meth = _Jv_FromReflectedConstructor (this);
   // In the constructor case the return type is the type of the
   // constructor.
index 8e3b7b2140da0863c6e3095be384627cfaf2d8db..95801e87570ec37d0aec327b3c816a17c86cfeb1 100644 (file)
@@ -156,6 +156,13 @@ java::lang::reflect::Method::invoke (jobject obj, jobjectArray args)
       // of the object.
       meth = _Jv_LookupDeclaredMethod (k, meth->name, meth->signature);
     }
+  else
+    {
+      // We have to initialize a static class.  It is safe to do this
+      // here and not in _Jv_CallAnyMethodA because JNI initializes a
+      // class whenever a method lookup is done.
+      _Jv_InitClass (declaringClass);
+    }
 
   return _Jv_CallAnyMethodA (obj, return_type, meth, false,
                             parameter_types, args);
@@ -405,8 +412,6 @@ _Jv_CallAnyMethodA (jobject obj,
       p += tsize;
     }
 
-  // FIXME: initialize class here.
-
   using namespace java::lang;
   using namespace java::lang::reflect;
 
This page took 0.06937 seconds and 5 git commands to generate.