Will it be worthy to add some public static final empty arrays for some most used types in some place in java.base, other than create them multi times in several places?

Pavel Rappo pavel.rappo at oracle.com
Sat Oct 9 17:53:56 UTC 2021


Empty? As in arrays of length zero?

There ought to be a much better solution. I'm neither an expert nor (sadly) an active follower of the Valhalla project [1]. Perhaps something there or in Frozen Arrays [2] will address the runtime cost of creating zero-length arrays much more elegantly.

[1] https://openjdk.java.net/projects/valhalla/
[2] https://openjdk.java.net/jeps/8261007

-Pavel

> On 9 Oct 2021, at 18:19, Xeno Amess <xenoamess at gmail.com> wrote:
> 
> I suggest putting them in Arrays btw.



More information about the core-libs-dev mailing list