Spliterator.IMMUTABLE

Remi Forax forax at univ-mlv.fr
Sun Mar 10 06:35:09 PDT 2013


On 03/10/2013 02:35 PM, Doug Lea wrote:
> On 03/10/13 09:26, Remi Forax wrote:
>> I've just discovered Spliterator.IMMUTABLE,
>> I think this flag has the wrong name, given it doesn't mean that the 
>> Spliterator
>> is immutable (usually tryAdvance change the state of the Spliterator) 
>> but the
>> fact that it doesn't act as a view of the collection that creates it.
>>
>
> ... and CONCURRENT doesn't mean that the Spliterator is concurrent.
> And so on. As stated in the javadocs, spliterator characteristics apply
> to the elements and/or their sources, not the Spliterators themselves.
> Maybe this could be better clarified in the javadocs.

Spliterator.IMMUTABLE doesn't means that the source is immutable too,
it means that even if the elements of the source changed after creation,
the element pushed by the Spliterator will not changed.

maybe SNAPSHOT is better ?

>
> -Doug
>
>
>

Rémi



More information about the lambda-libs-spec-experts mailing list