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

Arne Siegel v.a.ammodytes at googlemail.com
Fri Apr 19 12:43:11 PDT 2013


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
> 
> 


-------------- next part --------------
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
-------------- next part --------------
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