The XAWT for some native structures uses special java wrappers. These wrappers have to be created on top of the native pointer and provide access to the native fields directly w/o JNI methods.
We have incorrect usage of such wrapper in the XToolkit class:
Toolkit creates AwtScreenData wrapper on top of the XToolkit.getDefaultScreenData()
https://hg.openjdk.java.net/jdk/jdk/file/321b6fbe6815/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java#l344
But unfortunately, this native method returns the wrong pointer to getDefaultConfig():
https://hg.openjdk.java.net/jdk/jdk/file/321b6fbe6815/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c#l134
getScreenData() should be used instead of getDefaultConfig() since native data for default configuration is bigger than screen data we most of the time read some "random" information about visual info.