BUG - JNI misuse

I have compiled a couple jogl demos with JET, only to discover that they crash as follows:


CANVAS GL IS: net.java.games.jogl.impl.windows.WindowsGLImpl
CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl
Exception in thread "Thread-1" java.lang.ClassCastException: net.java.games.jogl.impl.wind
ows.JAWT_Win32DrawingSurfaceInfo

Our engineers have identified the cause of the problem to be JNI misuse.

Specifically, native method net.java.games.jogl.impl.platformInfo0 should return an instance of JAWT_PlatformInfo interface.

In fact, it returns an instance of net.java.games.jogl.impl.windows.JAWT_Win32DrawingSurfaceInfo class which does not implement that interface.

Hotspot does not perform interface-cast and simply ignores this fact, but JET attempts to make the cast and fails.

The latest nightly build seems to have this problem too.

Thanks for tracking down and pointing out this bug. I filed issue 68 to track it and just checked in a fix to GlueGen and the appropriate build files. Note that the fix has only been tested on Windows so far but all platforms’ JAWT .cfg files have been updated. Fix will be present in the nightly builds.