This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Fix PR 21020


I'm checking this in on the trunk.

This is a proper fix for PR 21020; for 4.0 we worked around this in a
different way.  Andrew wrote this; I just ran across it again today
while looking through bugzilla a bit.

A while back I looked at all other callers of
_Jv_FindClassFromSignature; this one is the only problem.

Tom

Index: ChangeLog
from  Andrew Haley  <aph@redhat.com>

	PR libgcj/21020:
	* jni.cc (_Jv_JNI_GetAnyFieldID): Use class' loader to find
	field's type.

Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.97
diff -u -r1.97 jni.cc
--- jni.cc 22 Apr 2005 19:02:38 -0000 1.97
+++ jni.cc 26 Apr 2005 20:43:12 -0000
@@ -1200,11 +1200,11 @@
       char s[len + 1];
       for (int i = 0; i <= len; ++i)
 	s[i] = (sig[i] == '/') ? '.' : sig[i];
-      jclass field_class = _Jv_FindClassFromSignature ((char *) s, NULL);
+      java::lang::ClassLoader *loader = clazz->getClassLoaderInternal ();
+      jclass field_class = _Jv_FindClassFromSignature ((char *) s, loader);
       if (! field_class)
 	throw new java::lang::ClassNotFoundException(JvNewStringUTF(s));
 
-      java::lang::ClassLoader *loader = clazz->getClassLoaderInternal ();
       while (clazz != NULL)
 	{
 	  // We acquire the class lock so that fields aren't resolved


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]