On Wed, 6 Mar 2024 20:47:53 GMT, Harshitha Onkar <[email protected]> wrote:

>> Alisen Chung has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   implemented changes from feedback
>
> test/jdk/java/awt/TrayIcon/DisposeInActionEventTest/DisposeInActionEventTest.java
>  line 84:
> 
>> 82:         } finally {
>> 83:             systemTray.remove(trayIcon);
>> 84:         }
> 
> @alisenchung I missed adding null check here earlier. It is good to have this 
> safety check to avoid NPE.
> 
> Suggestion:
> 
>         } finally {
>             if (systemTray != null) {
>                systemTray.remove(trayIcon);
>             }
>          }

`SystemTray.getSystemTray()` can't return `null`. However, the static field 
`systemTray` can remain `null` in the test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17838#discussion_r1516326933

Reply via email to