On Mon, 23 May 2022 20:24:52 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> ok ... why ? > > It's explained in Aleksey Shipilёv's article > https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_conclusion In fact, there's no need to create zero-sized array, there's one already: `EMPTY_TRAY_ARRAY`. Yet the code may look weird with it. return icons.toArray(EMPTY_TRAY_ARRAY); ------------- PR: https://git.openjdk.java.net/jdk/pull/8850