Does jni work?

Tom Tromey tromey@redhat.com
Thu Jan 25 23:27:00 GMT 2001


>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:

Bryce> java/lang/System::out lookup failed
Bryce> Exception in thread "main" java.lang.ClassNotFoundException: Ljava/io/PrintStream;
Bryce> It looks like the GetStaticField() etc implementations may need
Bryce> some work.
Yeah, I think maybe _Jv_JNI_GetAnyFieldID should be changed to always
use _Jv_FindClassFromSignature. I looked at the JNI docs and they
document the argument as a `signature'; a different part of the docs
documents signatures.
Martin, could you try the appended (untested) patch?
Tom
Index: jni.cc
===================================================================
RCS file: /cvs/gcc/egcs/libjava/jni.cc,v
retrieving revision 1.34
diff -u -r1.34 jni.cc
--- jni.cc	2000年11月01日 00:18:03	1.34
+++ jni.cc	2001年01月26日 07:26:44
@@ -1,6 +1,6 @@
 // jni.cc - JNI implementation, including the jump table.
 
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
 
 This file is part of libgcj.
 
@@ -1053,14 +1053,7 @@
 
 _Jv_Utf8Const *a_name = _Jv_makeUtf8Const ((char *) name, -1);
 
- jclass field_class = NULL;
- if (sig[0] == '[')
-	field_class = _Jv_FindClassFromSignature ((char *) sig, NULL);
- else
-	{
-	 _Jv_Utf8Const *sig_u = _Jv_makeUtf8Const ((char *) sig, -1);
-	 field_class = _Jv_FindClass (sig_u, NULL);
-	}
+ jclass field_class = _Jv_FindClassFromSignature ((char *) sig, NULL);
 
 // FIXME: what if field_class == NULL?
 


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /