JNI Bug report / C++ issues

Archie Cobbs archie at whistle.com
Wed Oct 28 09:12:32 PST 1998


Johannes Deisenhofer writes:
> However, kaffe's JNI include files do contain some errors that I've 
> listed below:
> 
>  - NewXXXArray() should return jXXXArray instead of jarray
>    This is a problem in C++, since these types are not simply casted to jref
>  - NewGlobalRef() does return jobject in JDK 
>  - DefineClass() does have an extra name argument in JDK 1.1.5
>  - GetSuperClass is spelled GetSuperclass in JDK.
>  - java.lang.StringBuffer.setLength has a bug:
>       System.arraycopy throws exception, because copied buffer len
>       exceeds allocated source buffer len.
> 
> Not a bug, but a missing feature:
> 
> SUN's JNI headers do provide a special interface for C++. Unfortunately,
> they do not allow to use the C-Interface from C++.
> 
> So, when using C++, I'm forced to use the C++-Interface with the JDK, 
> which on the other hand, kaffe does not provide. 
> 
> I'd like to provide the necessary patches to make kaffe more compatible.
> There are a few options to do this:
>  1) Just copy the missing parts from SUN JDK headers. Copyright problem?
>  2) Type in something that behaves identical, but avoid copying. Since
>     symbol names have to be identical, it would be very close to 1) beside 
>     whitespace.
>  3) Provide a hook so one can add an external C++-Wrapper. Have at least 
>     an option to avoid some typedefs like jobject,JNIEnv, JavaVM.
> 
> What option do you prefer?

Please provide patches using 'diff -u' and send them to this list.

Thanks,
-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list