RFR 8024405: Spliterators.spliterator should support CONCURRENT characteristic

Paul Sandoz paul.sandoz at oracle.com
Mon Sep 16 19:13:30 UTC 2013

On Sep 16, 2013, at 8:27 PM, Martin Buchholz <martinrb at google.com> wrote:
> delete "the" typo
> +     * @param characteristics Characteristics of the this spliterator's source
> A top-level Spliterator should not report CONCURRENT and SIZED
> =>
> A top-level Spliterator should not report both CONCURRENT and SIZED

Thanks i updated Spliterators and Spliterator.

> I think the docs for SIZED can make it clearer that it is an error for the size to change while the spliterator is in progress.  One can imagine CONCURRENT data structures whose SIZE does not change.  An iterator over an AtomicReferenceArray comes to mind.

I presume each element is an instance of AtomicReference? so elements of the array are not concurrently replaced but the values held by the ARs, and the iterator would need to report a ConcurrentModificationException if structural interference is detected? under such circumstances it might be OK for a spliterator of such a data structure to report SIZED/SUBSIZED.


More information about the core-libs-dev mailing list