jdk/src/share/classes/java/util/stream/IntStream.java
changeset 18572 53b8b8c30086
parent 18158 d5a620310f97
child 18820 a87cdd6a8834
--- a/jdk/src/share/classes/java/util/stream/IntStream.java	Tue Jun 11 13:41:38 2013 -0700
+++ b/jdk/src/share/classes/java/util/stream/IntStream.java	Fri Jun 28 10:29:21 2013 +0200
@@ -745,15 +745,8 @@
      */
     public static IntStream generate(IntSupplier s) {
         Objects.requireNonNull(s);
-        return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(
-                new PrimitiveIterator.OfInt() {
-                    @Override
-                    public boolean hasNext() { return true; }
-
-                    @Override
-                    public int nextInt() { return s.getAsInt(); }
-                },
-                Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL));
+        return StreamSupport.intStream(
+                new StreamSpliterators.InfiniteSupplyingSpliterator.OfInt(Long.MAX_VALUE, s));
     }
 
     /**