-
Bug
-
Resolution: Unresolved
-
P4
-
8, 9
A DESCRIPTION OF THE PROBLEM :
The accumulator in the following Stream methods
<R> R collect(Supplier<R> supplier,
BiConsumer<R,? super T> accumulator,
BiConsumer<R,R> combiner)
and
<U> U reduce(U identity,
BiFunction<U,? super T,U> accumulator,
BinaryOperator<U> combiner)
are marked as associative in the javadoc description . But they cannot be associative as their input parameters are of different type (or at least they can be).
This is a little bit confusing.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
accumulator - an non-interfering, stateless function for incorporating an additional element into a result
ACTUAL -
accumulator - an associative, non-interfering, stateless function for incorporating an additional element into a result
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html
The accumulator in the following Stream methods
<R> R collect(Supplier<R> supplier,
BiConsumer<R,? super T> accumulator,
BiConsumer<R,R> combiner)
and
<U> U reduce(U identity,
BiFunction<U,? super T,U> accumulator,
BinaryOperator<U> combiner)
are marked as associative in the javadoc description . But they cannot be associative as their input parameters are of different type (or at least they can be).
This is a little bit confusing.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
accumulator - an non-interfering, stateless function for incorporating an additional element into a result
ACTUAL -
accumulator - an associative, non-interfering, stateless function for incorporating an additional element into a result
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html