jni.cc (_Jv_JNI_FindClass): Use system class loader if class doesn't have a loader.

* jni.cc (_Jv_JNI_FindClass): Use system class loader if class
	doesn't have a loader.

From-SVN: r33272
This commit is contained in:
Tom Tromey 2000-04-20 05:49:48 +00:00 committed by Tom Tromey
parent 807bc1db3d
commit af98124ef9
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2000-04-19 Tom Tromey <tromey@cygnus.com>
* jni.cc (_Jv_JNI_FindClass): Use system class loader if class
doesn't have a loader.
2000-04-19 Bryce McKinlay <bryce@albatross.co.nz>
* boehm.cc: (_Jv_MarkObj, _Jv_MarkArray): Cast pointers for

View File

@ -424,15 +424,16 @@ _Jv_JNI_FindClass (JNIEnv *env, const char *name)
// This might throw an out of memory exception.
jstring n = JvNewStringUTF (s);
java::lang::ClassLoader *loader;
if (env->klass == NULL)
java::lang::ClassLoader *loader = NULL;
if (env->klass != NULL)
loader = env->klass->getClassLoader ();
if (loader == NULL)
{
// FIXME: should use getBaseClassLoader, but we don't have that
// yet.
loader = java::lang::ClassLoader::getSystemClassLoader ();
}
else
loader = env->klass->getClassLoader ();
r = loader->loadClass (n);
}