RFR-8148748: ArrayList.subList().spliterator() is not late-binding

Tagir F. Valeev amaembo at gmail.com
Fri Mar 4 14:38:50 UTC 2016


Hello!

Thank you for the review!

Here's updated webrev:
http://cr.openjdk.java.net/~tvaleev/webrev/8148748/r3/

PS> Looks good. I especially like:

PS>  125             addCollection(l.andThen(list -> list.subList(0, list.size())));

PS> Can you also update SpliteratorTraversingAndSplittingTest?

PS> void addList(Function<Collection<T>, ? extends List<T>> l) {
PS>     // @@@ If collection is instance of List then add sub-list tests
PS>     addCollection(l);
PS> }

Done.

>> Now it's separate anonymous class as you suggested.
>> ArrayListSpliterator is untouched. Note that trySplit() can return
>> original ArrayListSpliterator as after the binding their behavior is
>> compatible.
>> 

PS> Very nice, might be worth an extra comment noting that. Up to you.

Short comments added.

With best regards,
Tagir Valeev.




More information about the core-libs-dev mailing list