--- 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));
}
/**