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

        collection.toArray()

    is "identical in function" to

        collection.toArray(new Object[0]);

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)

HTH

David Holmes

Reply via email to