mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8130023: API java.util.stream: explicitly specify guaranteed execution of the pipeline
Reviewed-by: briangoetz, redestad
This commit is contained in:
parent
e988331331
commit
53ef4fecbf
5 changed files with 58 additions and 8 deletions
|
@ -209,6 +209,11 @@ public interface IntStream extends BaseStream<Integer, IntStream> {
|
|||
* .sum();
|
||||
* }</pre>
|
||||
*
|
||||
* <p>In cases where stream implementation is able to optimize away the
|
||||
* production of some or all the elements (such as with short-circuiting
|
||||
* operations like {@code findFirst}, or in the example described in
|
||||
* {@link #count}), the action will not be invoked for those elements.
|
||||
*
|
||||
* @param action a <a href="package-summary.html#NonInterference">
|
||||
* non-interfering</a> action to perform on the elements as
|
||||
* they are consumed from the stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue