RFR: 8001647: In-place methods on Collection/List

Akhil Arora akhil.arora at oracle.com
Sat Apr 20 21:22:03 PDT 2013


Thanks Arne, pushed your bugfix to lambda and updated webrev #9 for TL

I made one additional change - since 'j' now starts from 0, it needs to 
be incremented by 'from' for the portion after the 'to' index.

http://hg.openjdk.java.net/lambda/lambda/jdk/rev/a8b9c58fbd24

On 04/19/2013 12:43 PM, Arne Siegel wrote:
> Hi Akhil,
>
> please have another look at the the use of variable j in the private removeIf method in
> CopyOnWriteArrayList.java. It will not work correctly for sublists. I attached a test program for
> the webrev implementation and a corrected version of the same program, the important
> difference being:
>
> 63c63
> <                 int j = from;
> ---
>>                  int j = 0;
> 69c69
> <                     newElements[j++] = elements[from + i];
> ---
>>                      newElements[from + j++] = elements[from + i];
>
> Yours
> Arne Siegel
>
>
>
> On 18 Apr 2013 at 11:49, Akhil Arora wrote:
>
>> Looks like the stars are aligning on getting on this into TL... the
>> refreshed webrev is -
>>
>> http://cr.openjdk.java.net/~akhil/8001647.8/webrev/
>>
>> Please review
>>
>> Thanks
>>
>> On 12/10/2012 09:31 PM, Akhil Arora wrote:
>>> http://cr.openjdk.java.net/~akhil/8001647.3/webrev/
>>>
>>> - now with synchronized and unmodifiable wrappers in Collections.java
>>> for the default methods being added
>>>
>>> On 12/10/2012 01:48 PM, Akhil Arora wrote:
>>>> Updated with yours and Alan's comments -
>>>>
>>>> http://cr.openjdk.java.net/~akhil/8001647.2/webrev/
>>>>
>>>> - removed null check for removeSet
>>>> - cache this.size in removeAll, replaceAll
>>>>       (for ArrayList, Vector and CopyOnWriteArrayList)
>>>> - calculate removeCount instead of BitCount.cardinality()
>>>> - removed unnecessary @library from test support classes
>>
>>
>
>
>
>
> The following section of this message contains a file attachment
> prepared for transmission using the Internet MIME message format.
> If you are using Pegasus Mail, or any other MIME-compliant system,
> you should be able to save it or view it from within your mailer.
> If you cannot, please ask your system administrator for assistance.
>
>     ---- File information -----------
>       File:  TestRemoveIf.java
>       Date:  19 Apr 2013, 21:34
>       Size:  2985 bytes.
>       Type:  Unknown
>
>
>
> The following section of this message contains a file attachment
> prepared for transmission using the Internet MIME message format.
> If you are using Pegasus Mail, or any other MIME-compliant system,
> you should be able to save it or view it from within your mailer.
> If you cannot, please ask your system administrator for assistance.
>
>     ---- File information -----------
>       File:  TestRemoveIf_Fixed.class
>       Date:  19 Apr 2013, 21:38
>       Size:  2644 bytes.
>       Type:  Unknown
>



More information about the lambda-dev mailing list