RFR: 8286663: Resolve IDE warnings in WTrayIconPeer and SystemTray [v2]
Harshitha Onkar
honkar at openjdk.java.net
Wed May 25 17:56:50 UTC 2022
On Tue, 24 May 2022 11:20:36 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> **WTrayIconPeer**: removed duplicate call to `popupParent.dispose()` that might cause NPE (it looks `popupParent` cannot be `null`); organised imports.
>>
>> **SystemTray**: removed redundant initialisers; replaced sized array with empty array in `toArray` call; dropped `newValue != null` chained with `equals`.
>
> Alexey Ivanov has updated the pull request incrementally with three additional commits since the last revision:
>
> - toArray: new TrayIcon[0] -> EMPTY_TRAY_ARRAY - use existing empty array
> - Drop explicit type argument
> - Make popupParent final
@aivanov-jdk In SystemTray.java the following line can be simplified using method reference or lambda expression.
https://github.com/openjdk/jdk/blob/a2f8c9523438ca63380b0b7d4909d5e5e7fbf88a/src/java.desktop/share/classes/java/awt/SystemTray.java#L135
@aivanov-jdk In SystemTray.java the following line can be simplified using method reference or lambda expression.
https://github.com/openjdk/jdk/blob/a2f8c9523438ca63380b0b7d4909d5e5e7fbf88a/src/java.desktop/share/classes/java/awt/SystemTray.java#L135
-------------
PR: https://git.openjdk.java.net/jdk/pull/8850
More information about the client-libs-dev
mailing list