Collection.toArray <was> Re: Loose ends inventory

Doug Lea dl at cs.oswego.edu
Tue Jun 11 09:12:00 PDT 2013


On 06/11/13 12:02, Brian Goetz wrote:

>     -- The no-arg always allocates and returns an Object[] array instead of the
> right type, which is usually not what the user wants

Although when the "user" is an ArrayList or other array-based collection
an Object[] is the ONLY thing it can accept. this is a byproduct of erasure
compromises.

>>
>> Why not just given another name?

... like toGeneratedArray?

-Doug



More information about the lambda-libs-spec-experts mailing list