changeset 6391:218bdab80e30

Restore missing wildcards in Iterators.{map,filter} methods
author briangoetz
date Mon, 12 Nov 2012 20:17:39 -0500
parents bd225e0a0200
children 8ec18bd1b55f 3b1593c9f320
files src/share/classes/java/util/Iterators.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/Iterators.java	Mon Nov 12 20:16:28 2012 -0500
+++ b/src/share/classes/java/util/Iterators.java	Mon Nov 12 20:17:39 2012 -0500
@@ -91,7 +91,7 @@
         };
     }
 
-    public static<T> Iterator<T> filter(final Iterator<T> source, final Predicate<? super T> predicate) {
+    public static<T> Iterator<T> filter(final Iterator<? extends T> source, final Predicate<? super T> predicate) {
         Objects.requireNonNull(source);
         Objects.requireNonNull(predicate);
         return new Iterator<T>() {
@@ -120,7 +120,7 @@
         };
     }
 
-    public static<T, R> Iterator<R> map(final Iterator<T> source, final Mapper<? extends R, ? super T> mapper) {
+    public static<T, R> Iterator<R> map(final Iterator<? extends T> source, final Mapper<? extends R, ? super T> mapper) {
         Objects.requireNonNull(source);
         Objects.requireNonNull(mapper);
         return new Iterator<R>() {