8169808: Stream returning methods should specify if they are late binding

Reviewed-by: martin
This commit is contained in:
Paul Sandoz 2016-11-23 10:35:43 -08:00
parent 36ffe056e1
commit 11b92f7ddb
2 changed files with 14 additions and 7 deletions

View File

@ -121,8 +121,11 @@ public interface CharSequence {
* href="{@docRoot}/java/lang/Character.html#unicode">surrogate code
* point</a> is passed through uninterpreted.
*
* <p>If the sequence is mutated while the stream is being read, the
* result is undefined.
* <p>The stream binds to this sequence when the terminal stream operation
* commences (specifically, for mutable sequences the spliterator for the
* stream is <a href="../Spliterator.html#binding"><em>late-binding</em></a>).
* If the sequence is modified during that operation then the result is
* undefined.
*
* @return an IntStream of char values from this sequence
* @since 1.8
@ -168,8 +171,11 @@ public interface CharSequence {
* unpaired surrogates, and undefined code units, are zero-extended to
* {@code int} values which are then passed to the stream.
*
* <p>If the sequence is mutated while the stream is being read, the result
* is undefined.
* <p>The stream binds to this sequence when the terminal stream operation
* commences (specifically, for mutable sequences the spliterator for the
* stream is <a href="../Spliterator.html#binding"><em>late-binding</em></a>).
* If the sequence is modified during that operation then the result is
* undefined.
*
* @return an IntStream of Unicode code points from this sequence
* @since 1.8

View File

@ -1210,9 +1210,10 @@ public class BitSet implements Cloneable, java.io.Serializable {
* is the number of bits in the set state, equal to the value
* returned by the {@link #cardinality()} method.
*
* <p>The bit set must remain constant during the execution of the
* terminal stream operation. Otherwise, the result of the terminal
* stream operation is undefined.
* <p>The stream binds to this bit set when the terminal stream operation
* commences (specifically, the spliterator for the stream is
* <a href="../Spliterator.html#binding"><em>late-binding</em></a>). If the
* bit set is modified during that operation then the result is undefined.
*
* @return a stream of integers representing set indices
* @since 1.8