diff options
author | Tom Tromey <tromey@redhat.com> | 2002-08-27 23:57:17 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-08-27 23:57:17 +0000 |
commit | f87999337abbc750e4ce0b226fbd0f5fea38ad7e (patch) | |
tree | 8a4500dc40ccf200051295523ea06e24d9d8fc2a /libjava | |
parent | 7ee425e4d463bc44dbb81456ff89085f7239596c (diff) | |
download | gcc-f87999337abbc750e4ce0b226fbd0f5fea38ad7e.zip gcc-f87999337abbc750e4ce0b226fbd0f5fea38ad7e.tar.gz gcc-f87999337abbc750e4ce0b226fbd0f5fea38ad7e.tar.bz2 |
natConstructor.cc (newInstance): Initialize class.
* java/lang/reflect/natConstructor.cc (newInstance): Initialize
class.
* java/lang/reflect/natMethod.cc (invoke): Initialize class.
From-SVN: r56624
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natConstructor.cc | 4 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natMethod.cc | 9 |
3 files changed, 16 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f400148..9ae3d6a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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, diff --git a/libjava/java/lang/reflect/natConstructor.cc b/libjava/java/lang/reflect/natConstructor.cc index 1103d77..7f90b12 100644 --- a/libjava/java/lang/reflect/natConstructor.cc +++ b/libjava/java/lang/reflect/natConstructor.cc @@ -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. diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index 8e3b7b2..95801e8 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -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; |