Here's the trick that we want to be Java coded since its a JDK bug. The native library will be modified accordingly to avoid redundancy (see further below).