Commit af98124e by Tom Tromey Committed by Tom Tromey

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
parent 807bc1db
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
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment