ArrayFactory SAM type / toArray
Brian Goetz
brian.goetz at oracle.com
Thu Nov 8 08:43:54 PST 2012
On 9/19/2012 10:27 PM, Raab, Donald wrote:
> Could we add the following methods to the Class class?
>
> T[] emptyArray()
> T[] newArray(int size)
I prototyped these, and they work fine for reference types but fall
apart for primitive arrays. There *is* a Class literal for int.class,
but we can't make it return an int[] with this method. (This is one
reason that Array.newInstance returns Object.) Performance testing
would be needed to ensure they are competitive with alternatives.
More information about the lambda-libs-spec-observers
mailing list