-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b77
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8136060 | emb-9 | Stuart Marks | P4 | Resolved | Fixed | team |
The "Parallelism" section of the java.util.stream package-info.java file has the following:
* <p>The only difference between the serial and parallel versions of this
* example is the creation of the initial stream, using "{@code parallelStream()}"
* instead of "{@code stream()}". When the terminal operation is initiated,
* the stream pipeline is executed sequentially or in parallel depending on the
* orientation of the stream on which it is invoked. Whether a stream will execute in serial or
* parallel can be determined with the {@code isParallel()} method, and the
* orientation of a stream can be modified with the
* {@link java.util.stream.BaseStream#sequential()} and
* {@link java.util.stream.BaseStream#parallel()} operations. When the terminal
* operation is initiated, the stream pipeline is executed sequentially or in
* parallel depending on the mode of the stream on which it is invoked.
It needs to be clarified that the sequential or parallel mode applies to the entire stream pipeline, not just the latest stream object, or something. (This is a repeated question from people learning the Streams API.)
Also, the second and the last sentences are redundant.
* <p>The only difference between the serial and parallel versions of this
* example is the creation of the initial stream, using "{@code parallelStream()}"
* instead of "{@code stream()}". When the terminal operation is initiated,
* the stream pipeline is executed sequentially or in parallel depending on the
* orientation of the stream on which it is invoked. Whether a stream will execute in serial or
* parallel can be determined with the {@code isParallel()} method, and the
* orientation of a stream can be modified with the
* {@link java.util.stream.BaseStream#sequential()} and
* {@link java.util.stream.BaseStream#parallel()} operations. When the terminal
* operation is initiated, the stream pipeline is executed sequentially or in
* parallel depending on the mode of the stream on which it is invoked.
It needs to be clarified that the sequential or parallel mode applies to the entire stream pipeline, not just the latest stream object, or something. (This is a repeated question from people learning the Streams API.)
Also, the second and the last sentences are redundant.
- backported by
-
JDK-8136060 clarify stream package documentation regarding sequential vs parallel modes
-
- Resolved
-