changeset 7828:360ebf593040

generics cleanup pass
author briangoetz
date Fri, 05 Apr 2013 15:14:09 -0400
parents c537f01643b4
children 215d9ddc8762
files src/share/classes/java/util/stream/DelegatingStream.java src/share/classes/java/util/stream/DoublePipeline.java src/share/classes/java/util/stream/DoubleStream.java src/share/classes/java/util/stream/IntPipeline.java src/share/classes/java/util/stream/IntStream.java src/share/classes/java/util/stream/LongPipeline.java src/share/classes/java/util/stream/LongStream.java src/share/classes/java/util/stream/ReferencePipeline.java src/share/classes/java/util/stream/Stream.java
diffstat 9 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/DelegatingStream.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/DelegatingStream.java	Fri Apr 05 15:14:09 2013 -0400
@@ -108,7 +108,7 @@
     }
 
     @Override
-    public <R> Stream<R> flatMap(Function<T, Stream<? extends R>> mapper) {
+    public <R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper) {
         return delegate.flatMap(mapper);
     }
 
--- a/src/share/classes/java/util/stream/DoublePipeline.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/DoublePipeline.java	Fri Apr 05 15:14:09 2013 -0400
@@ -191,7 +191,7 @@
     }
 
     @Override
-    public final <U> Stream<U> mapToObj(DoubleFunction<U> mapper) {
+    public final <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper) {
         Objects.requireNonNull(mapper);
         return new ReferencePipeline.StatelessOp<Double, U>(this, StreamShape.DOUBLE_VALUE,
                                                             StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) {
--- a/src/share/classes/java/util/stream/DoubleStream.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/DoubleStream.java	Fri Apr 05 15:14:09 2013 -0400
@@ -112,7 +112,7 @@
      *               each element
      * @return the new stream
      */
-    <U> Stream<U> mapToObj(DoubleFunction<U> mapper);
+    <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper);
 
     /**
      * Produces an {@code IntStream} consisting of the results of applying
--- a/src/share/classes/java/util/stream/IntPipeline.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/IntPipeline.java	Fri Apr 05 15:14:09 2013 -0400
@@ -219,7 +219,7 @@
     }
 
     @Override
-    public final <U> Stream<U> mapToObj(IntFunction<U> mapper) {
+    public final <U> Stream<U> mapToObj(IntFunction<? extends U> mapper) {
         Objects.requireNonNull(mapper);
         return new ReferencePipeline.StatelessOp<Integer, U>(this, StreamShape.INT_VALUE,
                                                              StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) {
--- a/src/share/classes/java/util/stream/IntStream.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/IntStream.java	Fri Apr 05 15:14:09 2013 -0400
@@ -113,7 +113,7 @@
      *               each element
      * @return the new stream
      */
-    <U> Stream<U> mapToObj(IntFunction<U> mapper);
+    <U> Stream<U> mapToObj(IntFunction<? extends U> mapper);
 
     /**
      * Produces a {@code LongStream} consisting of the results of applying
--- a/src/share/classes/java/util/stream/LongPipeline.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/LongPipeline.java	Fri Apr 05 15:14:09 2013 -0400
@@ -203,7 +203,7 @@
     }
 
     @Override
-    public final <U> Stream<U> mapToObj(LongFunction<U> mapper) {
+    public final <U> Stream<U> mapToObj(LongFunction<? extends U> mapper) {
         Objects.requireNonNull(mapper);
         return new ReferencePipeline.StatelessOp<Long, U>(this, StreamShape.LONG_VALUE,
                                                           StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) {
--- a/src/share/classes/java/util/stream/LongStream.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/LongStream.java	Fri Apr 05 15:14:09 2013 -0400
@@ -113,7 +113,7 @@
      *               each element
      * @return the new stream
      */
-    <U> Stream<U> mapToObj(LongFunction<U> mapper);
+    <U> Stream<U> mapToObj(LongFunction<? extends U> mapper);
 
     /**
      * Produces an {@code IntStream} consisting of the results of applying
--- a/src/share/classes/java/util/stream/ReferencePipeline.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/ReferencePipeline.java	Fri Apr 05 15:14:09 2013 -0400
@@ -239,7 +239,7 @@
     }
 
     @Override
-    public final <R> Stream<R> flatMap(Function<U, Stream<? extends R>> mapper) {
+    public final <R> Stream<R> flatMap(Function<? super U, ? extends Stream<? extends R>> mapper) {
         Objects.requireNonNull(mapper);
         // We can do better than this, by polling cancellationRequested when stream is infinite
         return flatMap((U u, Consumer<R> sink) -> mapper.apply(u).sequential().forEach(sink));
--- a/src/share/classes/java/util/stream/Stream.java	Fri Apr 05 14:44:30 2013 -0400
+++ b/src/share/classes/java/util/stream/Stream.java	Fri Apr 05 15:14:09 2013 -0400
@@ -183,7 +183,7 @@
      *               each element which produces a stream of new values
      * @return the new stream
      */
-    <R> Stream<R> flatMap(Function<T, Stream<? extends R>> mapper);
+    <R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper);
 
     /**
      * Produces a stream consisting of the results of replacing each