This is the mail archive of the
mailing list for the Java project.
Re: Fix for the env->klass field value in _Jv_JNIMethod::call
- From: Mark Wielaard <mark at klomp dot org>
- To: Ivan Dubrov <wfragg at gmail dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: Sun, 30 Jul 2006 14:24:06 +0200
- Subject: Re: Fix for the env->klass field value in _Jv_JNIMethod::call
- References: <44CC2639.firstname.lastname@example.org>
On Sun, 2006-07-30 at 10:23 +0700, Ivan Dubrov wrote:
> While debugging the issue with the Subclipse not working under the GCJ
> (look at the message
> http://svn.haxx.se/subusers/archive-2006-07/0210.shtml for example) I
> found the following problem. When native method is called, the
> env->klass value is always NULL. It looks like that JNIEnv is reused in
> the "_Jv_GetJNIEnvNewFrame" function and the env->klass value is not
> updated during the call.
> Perhaps, it is OK in most cases, except the cases with complex
> classloaders logic.
It is probably never correct. We were most likely just lucky that no JNI
library ever tried to load classes not found through the system class
loader. So we probably should just update env->klass inside
_Jv_GetJNIEnvNewFrame itself, just like we reset the pending exception.
_Jv_GetJNIEnvNewFrame already gets the defining class as argument.