Staring at LinkedTransferQueue.java, I see:

                    return Spliterators.spliterator
                        (a, 0, i, (Spliterator.ORDERED |
                                   Spliterator.NONNULL |
                                   Spliterator.CONCURRENT));

but ... that's a spliterator over an immutable array, so shouldn't we have
IMMUTABLE instead of CONCURRENT?

Looking further, I see ArraySpliterator requires its input array to be
unmodified during operation

         * @param array the array, assumed to be unmodified during use

("assumed" is weird in javadoc.  maybe "required"?)

but ArraySpliterator does not include IMMUTABLE in characteristics, even
though Arrays.spliterator does.

I suggest fixing all these array spliterator characteristics to always
report IMMUTABLE and never report CONCURRENT, and to document this fact, as
we already do with SIZED and SUBSIZED.

Reply via email to