<AWT Dev> RFR: 8238936 The crash in XRobotPeer when the custom GraphicsDevice is used

Alexander Zuev alexander.zuev at oracle.com
Mon Mar 2 16:21:47 UTC 2020

Hi Sergey,

   fix looks good. Just one quick question - in LightweightPeerHolder, 
why it was HeadlessException before?
Was there any code that expected it to throw this exact exception?


On 2/19/20 15:13, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for jdk/client.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8238936
> Fix: http://cr.openjdk.java.net/~serb/8238936/webrev.00
> Our Robot's peers have an incorrect assumption that all
> graphics devices passed to the constructor are supports.
>  - On windows, we simply ignore this device(even if the device
>    is a custom not "real" device) because we know we can move
>    the mouse on every screen.
>  - On macOS, we cast this device to the internal graphics device
>    and get ClassCastException.
>  - On Linux, we try to access the passed graphics device and its
>    config via JNI and get a crash.
> In the fix we throw AWTException if the device is not of the
> class of the real graphical device used by the AWT toolkit
> + small cleanup

More information about the awt-dev mailing list