David Holmes - Sun Microsystems wrote:
Thanks for the info, one query though ...

Ummm why didn't it just use:

    elementData = c.toArray(new Object[c.size()]);


Because "c" might be a concurrent collection, so you
don't want to independently call c.size(). Notice
that AbstractCollection correctly implements
toArray() even for such collections but cannot do so
for toArray(T[] a) because it must interpret
a.length as the required size.

-Doug



Reply via email to