RFR: 8316931: [macos14] Test "java/awt/TrayIcon/ShowAfterDisposeTest/ShowAfterDisposeTest.html" throws and exception on Mac OS 14(x64, aarch64)

Abhishek Kumar abhiscxk at openjdk.org
Wed Jan 10 06:00:25 UTC 2024


On Tue, 9 Jan 2024 21:06:50 GMT, Alisen Chung <achung at openjdk.org> wrote:

> SunToolkit.java is trying to post an event on the TrayIcon appContext, but the TrayIcon was already removed by the test, causing an error. The fix is to make SunToolkit skip posting the event if appContext is null. The test is also updated to remove applet usage and use PassFailJFrame instead.

test/jdk/java/awt/TrayIcon/ShowAfterDisposeTest/ShowAfterDisposeTest.java line 1:

> 1: /*

Please update copyright year.

test/jdk/java/awt/TrayIcon/ShowAfterDisposeTest/ShowAfterDisposeTest.java line 83:

> 81: 
> 82:     public void showFrameAndIcon() throws Exception {
> 83:         if (!traySupported) {

Looks like redundant. Same condition is checked in startTest() method

test/jdk/java/awt/TrayIcon/ShowAfterDisposeTest/ShowAfterDisposeTest.java line 88:

> 86: 
> 87:         SwingUtilities.invokeAndWait(() -> {
> 88:             frame = new JFrame();

Please add a frame title.

test/jdk/java/awt/TrayIcon/ShowAfterDisposeTest/ShowAfterDisposeTest.java line 89:

> 87:         SwingUtilities.invokeAndWait(() -> {
> 88:             frame = new JFrame();
> 89:             frame.setLayout (new BorderLayout());

Suggestion:

            frame.setLayout(new BorderLayout());

No need of space here and below as well.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17329#discussion_r1446918269
PR Review Comment: https://git.openjdk.org/jdk/pull/17329#discussion_r1446916922
PR Review Comment: https://git.openjdk.org/jdk/pull/17329#discussion_r1446917273
PR Review Comment: https://git.openjdk.org/jdk/pull/17329#discussion_r1446917478


More information about the client-libs-dev mailing list