c.toArray might (incorrectly) not return Object (see 6260652)
David Holmes - Sun Microsystems
David.Holmes at Sun.COM
Thu May 21 19:05:49 PDT 2009
Florian Weimer said the following on 05/22/09 03:18:
> So says the ArrayList(Collection) constructor. Can this bug report be
> opened? Is this workaround still necessary?
I'm confused. The bug states:
The Collection documentation claims that
is "identical in function" to
but I checked the Collection documentation back to 1.4.2 and it doesn't
say anything like that as far as I can see.
But as far as I can tell from the code the implementation is unchanged.
toArray() will "clone" the internal array and so if you really want
Object you have use toArray(someObjectArray)
More information about the core-libs-dev