RFR [8014066] Mistake in documentation of ArrayList#removeRange

Ulf Zibis Ulf.Zibis at CoSoCo.de
Wed Mar 19 22:02:47 UTC 2014


Am 19.03.2014 09:19, schrieb Ivan Gerasimov:
> Thank you Ulf!
>
> On 19.03.2014 2:12, Ulf Zibis wrote:
>> Am 18.03.2014 19:28, schrieb Ivan Gerasimov:
>>>
>>> Assuming this last iteration is OK, should the next step be a CCC request?
>>
>> Do you mean? :
>>      /*
>>       * ...
>> +     * It is assumed that fromIndex <= toIndex, otherwise the behaviour of this method is 
>> undefined.
>>       * ...
>>  -     *          toIndex < fromIndex})
>>       * ...
>>      */
>>      protected void removeRange(int fromIndex, int toIndex) {
>>          ...
>>
>
> The (fromIndex > toIndex) condition is checked now, so the behavior of the method is defined - it 
> throws an exception.

Because Martin stated some days ago, that it normally should not occur, that removeRange is invoked 
with toIndex < fromIndex, and checking this again unnecessarily decreases performance a little, I 
was hoping, your "next CCC step" would be to drop this check.

-Ulf




More information about the core-libs-dev mailing list