提交 ba39efdf 编写于 作者: P psandoz

8032190: Specifications of stream flatMap methods should require mapped streams to be closed

Reviewed-by: chegar, alanb
上级 2219b2bc
...@@ -150,10 +150,11 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> { ...@@ -150,10 +150,11 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> {
/** /**
* Returns a stream consisting of the results of replacing each element of * Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the * this stream with the contents of a mapped stream produced by applying
* provided mapping function to each element. (If the result of the mapping * the provided mapping function to each element. Each mapped stream is
* function is {@code null}, this is treated as if the result was an empty * {@link java.util.stream.BaseStream#close() closed} after its contents
* stream.) * have been placed into this stream. (If a mapped stream is {@code null}
* an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
......
...@@ -146,10 +146,11 @@ public interface IntStream extends BaseStream<Integer, IntStream> { ...@@ -146,10 +146,11 @@ public interface IntStream extends BaseStream<Integer, IntStream> {
/** /**
* Returns a stream consisting of the results of replacing each element of * Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the * this stream with the contents of a mapped stream produced by applying
* provided mapping function to each element. (If the result of the mapping * the provided mapping function to each element. Each mapped stream is
* function is {@code null}, this is treated as if the result was an empty * {@link java.util.stream.BaseStream#close() closed} after its contents
* stream.) * have been placed into this stream. (If a mapped stream is {@code null}
* an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
......
...@@ -151,10 +151,11 @@ public interface LongStream extends BaseStream<Long, LongStream> { ...@@ -151,10 +151,11 @@ public interface LongStream extends BaseStream<Long, LongStream> {
/** /**
* Returns a stream consisting of the results of replacing each element of * Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the * this stream with the contents of a mapped stream produced by applying
* provided mapping function to each element. (If the result of the mapping * the provided mapping function to each element. Each mapped stream is
* function is {@code null}, this is treated as if the result was an empty * {@link java.util.stream.BaseStream#close() closed} after its contents
* stream.) * have been placed into this stream. (If a mapped stream is {@code null}
* an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
......
...@@ -227,10 +227,11 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> { ...@@ -227,10 +227,11 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
/** /**
* Returns a stream consisting of the results of replacing each element of * Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the * this stream with the contents of a mapped stream produced by applying
* provided mapping function to each element. (If the result of the mapping * the provided mapping function to each element. Each mapped stream is
* function is {@code null}, this is treated as if the result was an empty * {@link java.util.stream.BaseStream#close() closed} after its contents
* stream.) * have been placed into this stream. (If a mapped stream is {@code null}
* an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
...@@ -270,10 +271,11 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> { ...@@ -270,10 +271,11 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
/** /**
* Returns an {@code IntStream} consisting of the results of replacing each * Returns an {@code IntStream} consisting of the results of replacing each
* element of this stream with the contents of the stream produced by * element of this stream with the contents of a mapped stream produced by
* applying the provided mapping function to each element. (If the result * applying the provided mapping function to each element. Each mapped
* of the mapping function is {@code null}, this is treated as if the result * stream is {@link java.util.stream.BaseStream#close() closed} after its
* was an empty stream.) * contents have been placed into this stream. (If a mapped stream is
* {@code null} an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
...@@ -288,11 +290,12 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> { ...@@ -288,11 +290,12 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
IntStream flatMapToInt(Function<? super T, ? extends IntStream> mapper); IntStream flatMapToInt(Function<? super T, ? extends IntStream> mapper);
/** /**
* Returns a {@code LongStream} consisting of the results of replacing each * Returns an {@code LongStream} consisting of the results of replacing each
* element of this stream with the contents of the stream produced * element of this stream with the contents of a mapped stream produced by
* by applying the provided mapping function to each element. (If the result * applying the provided mapping function to each element. Each mapped
* of the mapping function is {@code null}, this is treated as if the result * stream is {@link java.util.stream.BaseStream#close() closed} after its
* was an empty stream.) * contents have been placed into this stream. (If a mapped stream is
* {@code null} an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
...@@ -307,11 +310,12 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> { ...@@ -307,11 +310,12 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper); LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper);
/** /**
* Returns a {@code DoubleStream} consisting of the results of replacing each * Returns an {@code DoubleStream} consisting of the results of replacing
* element of this stream with the contents of the stream produced * each element of this stream with the contents of a mapped stream produced
* by applying the provided mapping function to each element. (If the result * by applying the provided mapping function to each element. Each mapped
* of the mapping function is {@code null}, this is treated as if the result * stream is {@link java.util.stream.BaseStream#close() closed} after its
* was an empty stream.) * contents have placed been into this stream. (If a mapped stream is
* {@code null} an empty stream is used, instead.)
* *
* <p>This is an <a href="package-summary.html#StreamOps">intermediate * <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>. * operation</a>.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册