On Thursday 07 September 2006 08:43, Tom Tromey wrote: > >>>>> "Raif" == Raif S Naffah <raif@xxxxxxxxxxxxxxx> writes: > > Raif> $ gcjh -jni -classpath . -o OC_IC.h OC$IC > > ... > Try OC\$IC and you will get a different result. indeed. > Raif> $ /opt/jdk1.5.0_08/bin/javah -jni -classpath . -o OC_IC.h OC$IC > > I'd guess that javah is also reading inner classes... gcjh will > probably never do this, I'm afraid, but we should probably modify the > javah in Classpath to be compatible here. That shouldn't be hard. > Could you file a PR?... no problems. > Raif> JNIEXPORT void JNICALL Java_OC_IC_natInit > > Hmm, gcjh generates Java_OC_00024IC_natInit. > I'm surprised by the above, I (obviously I suppose :) would have > picked the gcjh interpretation instead. > > Perhaps some experimentation is in order... what happens if you have a > class with an explicit '$' in its name that has a native method? i'm attaching an OC$.java source and the generated header using gcjh. same behaviour --the dollar symbol is replaced by its unicode codepoint. thanks for your prompt reply + cheers; rsn
public class OC$ { OC$() { super(); natInit(); } native void natInit(); }
/* DO NOT EDIT THIS FILE - it is machine generated */ #ifndef __OC$__ #define __OC$__ #include <jni.h> #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_OC_00024_natInit (JNIEnv *env, jobject); #ifdef __cplusplus } #endif #endif /* __OC$__ */
Attachment:
pgp3qZOVRR5AX.pgp
Description: PGP signature