A behavior mismatch in AbstractCollection.toArray(T )
zhouyx at linux.vnet.ibm.com
Wed Dec 14 02:42:37 UTC 2011
Yeah, that is the reason I think a declaimer about "not designed for
operation. " in the spec would be a proper choice.
On Tue, Dec 13, 2011 at 10:20 PM, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:
> IMO in 99.8 % this check would be superfluous overhead.
> For those, who want 100 %, they can check and copy in their code.
> Am 13.12.2011 14:30, schrieb Sean Chou:
> Sorry for the confuse. By "ok", I mean "compare the size of array which is
>> going to be
>> returned and the size of the specified array, and copy the elements
>> into the specified
>> array if it is larger and return the specified array."
>> Nothing is causing problem for now, I just found a mismatch. I think most
>> guys will
>> just use the returned array without checking if it's the specified one;
>> this is also
>> why I think it may be possible to modify the behavior without causing
>> And I think modifying ConcurrentHashMap is as dangerous as modifying
>> if people are relying on implementation, is this right? So it seems we can
>> do nothing
>> to the mismatch now...
More information about the core-libs-dev