提交 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> {
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the
* provided mapping function to each element. (If the result of the mapping
* function is {@code null}, this is treated as if the result was an empty
* stream.)
* this stream with the contents of a mapped stream produced by applying
* the provided mapping function to each element. Each mapped stream is
* {@link java.util.stream.BaseStream#close() closed} after its 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
* operation</a>.
......
......@@ -146,10 +146,11 @@ public interface IntStream extends BaseStream<Integer, IntStream> {
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the
* provided mapping function to each element. (If the result of the mapping
* function is {@code null}, this is treated as if the result was an empty
* stream.)
* this stream with the contents of a mapped stream produced by applying
* the provided mapping function to each element. Each mapped stream is
* {@link java.util.stream.BaseStream#close() closed} after its 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
* operation</a>.
......
......@@ -151,10 +151,11 @@ public interface LongStream extends BaseStream<Long, LongStream> {
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with the contents of the stream produced by applying the
* provided mapping function to each element. (If the result of the mapping
* function is {@code null}, this is treated as if the result was an empty
* stream.)
* this stream with the contents of a mapped stream produced by applying
* the provided mapping function to each element. Each mapped stream is
* {@link java.util.stream.BaseStream#close() closed} after its 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
* operation</a>.
......
......@@ -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
* this stream with the contents of the stream produced by applying the
* provided mapping function to each element. (If the result of the mapping
* function is {@code null}, this is treated as if the result was an empty
* stream.)
* this stream with the contents of a mapped stream produced by applying
* the provided mapping function to each element. Each mapped stream is
* {@link java.util.stream.BaseStream#close() closed} after its 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
* operation</a>.
......@@ -270,10 +271,11 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
/**
* Returns an {@code IntStream} consisting of the results of replacing each
* element of this stream with the contents of the stream produced by
* applying the provided mapping function to each element. (If the result
* of the mapping function is {@code null}, this is treated as if the result
* was an empty stream.)
* element of this stream with the contents of a mapped stream produced by
* applying the provided mapping function to each element. Each mapped
* stream is {@link java.util.stream.BaseStream#close() closed} after its
* 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
* operation</a>.
......@@ -288,11 +290,12 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
IntStream flatMapToInt(Function<? super T, ? extends IntStream> mapper);
/**
* Returns a {@code LongStream} consisting of the results of replacing each
* element of this stream with the contents of the stream produced
* by applying the provided mapping function to each element. (If the result
* of the mapping function is {@code null}, this is treated as if the result
* was an empty stream.)
* Returns an {@code LongStream} consisting of the results of replacing each
* element of this stream with the contents of a mapped stream produced by
* applying the provided mapping function to each element. Each mapped
* stream is {@link java.util.stream.BaseStream#close() closed} after its
* 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
* operation</a>.
......@@ -307,11 +310,12 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper);
/**
* Returns a {@code DoubleStream} consisting of the results of replacing each
* element of this stream with the contents of the stream produced
* by applying the provided mapping function to each element. (If the result
* of the mapping function is {@code null}, this is treated as if the result
* was an empty stream.)
* Returns an {@code DoubleStream} consisting of the results of replacing
* each element of this stream with the contents of a mapped stream produced
* by applying the provided mapping function to each element. Each mapped
* stream is {@link java.util.stream.BaseStream#close() closed} after its
* 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
* operation</a>.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册