<Swing Dev> [12] Review Request: 8198321 javax/swing/JEditorPane/5076514/bug5076514.java fails

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Thu Nov 8 21:04:57 UTC 2018

Please review the fix for jdk 12.

Bug: https://bugs.openjdk.java.net/browse/JDK-8198321
Webrev: http://cr.openjdk.java.net/~serb/8198321/webrev.00

This test verifies that "JEditorPane.copy()" method will trigger
security check for "accessClipboard" permission. This is the same permission
which is used for Toolkit.getSystemClipboard() to access the system clipboard.

The problem is that in the headless environment we do not have system clipboard.
as example the method getSystemClipboard() simply throw HeadlessException.

The "JEditorPane.copy()" will skip security check if the system is headless, and
will use the Clipboard per-Appcontext.

In the fix the case for headless mode was added.

Best regards, Sergey.

More information about the swing-dev mailing list