RFR: 8286663: Resolve IDE warnings in WTrayIconPeer and SystemTray [v2]

Alexey Ivanov aivanov at openjdk.java.net
Wed May 25 18:18:42 UTC 2022


On Wed, 25 May 2022 17:53:31 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> @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

I left it out intentionally, it's still unclear to me what style the client-libs follow.

I prefer using method references where possible.

If method reference is used, the code becomes much shorter:


        AWTAccessor.setSystemTrayAccessor(SystemTray::firePropertyChange);


What do others think?

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

PR: https://git.openjdk.java.net/jdk/pull/8850



More information about the client-libs-dev mailing list