RFR 8164691 Stream specification clarifications for iterate and collect

Paul Sandoz paul.sandoz at oracle.com
Wed Sep 7 15:14:30 UTC 2016


> On 7 Sep 2016, at 00:49, Stefan Zobel <spliterator at gmail.com> wrote:
> 
> 2016-09-07 1:22 GMT+02:00 Paul Sandoz <paul.sandoz at oracle.com>:
>> 
>>> On 3 Sep 2016, at 15:06, Stefan Zobel <spliterator at gmail.com> wrote:
>>> 
>>> Hi Paul,
>>> 
>>> there's a small copy & paste error in the code samples in
>>> Double/Int/LongStream#iterate()
>>> 
>>> Example DoubleStream#iterate:
>>> 
>>>    * <pre>{@code
>>>    *     for (T index=seed; hasNext.test(index); index = next.apply(index)) {
>>>    *         ...
>>>    *     }
>>>    * }</pre>
>>> 
>>> That should be
>>> 
>>>    *     for (double index=seed; hasNext.test(index); index =
>>> next.applyAsDouble(index)) {
>>> 
>>> 
>>> Same for Int/LongStream#iterate()
>>> 
>> 
>> Thanks, well spotted, fixed in place.
> 
> 
> Almost: next.apply(index) => next.applyAsDouble(index)
> 

Grrr… updated. Thanks for being vigilant. I hesitated to update these, since we don’t mention the types, but i think it’s best to refer to method names corresponding to those of functional interfaces that would likely be used.

Paul.


More information about the core-libs-dev mailing list