RFR(m) 2: 8072722: add stream support to Scanner

Xueming Shen xueming.shen at oracle.com
Wed Sep 9 22:51:29 UTC 2015


One more comment regarding the CME check.

2829                     if (expectedCount != modCount) {
2830                         throw new ConcurrentModificationException();
2831                     }


While it definitely serves the purpose of "fail-fast", but given it's a ordered/sequential
stream, this condition is always checked in the immediate next round of tryAdvance().
Just doubt it really benefits anyone. It's true that it almost costs nothing though.

-Sherman

On 09/09/2015 03:35 PM, Xueming Shen wrote:
> Hi Stuart,
>
> Can't modCount be increased to negative in extreme case?
>
> 2705             if (expectedCount>= 0&&  expectedCount != modCount) {
> 2706                 throw new ConcurrentModificationException();
> 2707             }
>
> It'd be better to initialize expectedCount to modCount in constrocutor?
>
> Sherman
>
> On 09/09/2015 03:07 PM, Stuart Marks wrote:
>>
>>
>> On 9/9/15 2:32 PM, Stuart Marks wrote:
>>> I'll change the occurrences of "pipeline execution" to "stream pipeline
>>> execution" per your exchange with Paul. Looks like there are two such
>>> occurrences in each of the tokens() and findAll() methods.
>>
>> Er, three such occurrences.
>>
>> Webrev: (final, I hope)
>>
>>   http://cr.openjdk.java.net/~smarks/reviews/8072722/webrev.4/
>>
>> Specdiff:
>>
>>
>> http://cr.openjdk.java.net/~smarks/reviews/8072722/specdiff.4/overview-summary.html
>>
>> s'marks
>




More information about the core-libs-dev mailing list