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

Alexey Ivanov aivanov at openjdk.java.net
Thu Jun 2 08:21:19 UTC 2022


On Thu, 2 Jun 2022 00:36:28 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> BTW I think that the usage of
> `return icons.toArray(EMPTY_TRAY_ARRAY);`
> is slower than any of other cases: presized or zero. So if we would like to use a similar pattern the zero version is better.

Why is it? It's the same as `icons.toArray(new TrayIcon[0])` without creating a new zero-sized array.

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

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



More information about the client-libs-dev mailing list