This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Bug in JNI RegisterNatives?
Juerg Lehni wrote:
I'm happy to write the patch but would need to know a few more things
first.
Some questions:
- Is _Jv_LookupJNIMethod used each time a methods registered in that
way is called, or is it only called once, and then linked directly to
the native pointer?
It is called once, then the pointer returned is saved locally.
- Should I create a new struct as a base for nathash, or continue to
use JNINativeMethod and just concatenate the class name and the method
name, seperated with a '.' and store that in the JNINativeMethod name
field? I guess a new struct would be cleaner, as JNINativeMethod is
also used outside jni.cc.
Sounds good.
- What is the easiest way to retrieve the class name in UTF8 format?
Is there something faster / easier than klass->getName() and then
convert?
klass->name will give you the Utf8Const name. You may need to add a
friend declaration to java/lang/Class.h for this to work.
Bryce