Details
-
Bug
-
Resolution: Fixed
-
P2
-
None
-
b92
-
b100
-
Verified
Description
Since approximately JDK8-lambda build 92 the following regression is being observed:
the following code:
Stream stream = new TreeSet(Arrays.asList("a", "b")).stream();
Stream substream = stream.substream(1);
Stream parallel = (Stream) substream.parallel();
java.util.Iterator iterator = parallel.iterator();
System.out.println("iterator.hasNext() = " + iterator.hasNext());
System.out.println("iterator.next() = " + iterator.next());
will produce output like:
----------------------------------------
iterator.hasNext() = false
Exception in thread "main" java.util.NoSuchElementException
----------------------------------------
The code works as expected with JDK8b95 main JDK8 binaries producing iterator over a single element "b".
Plenty of JCK tests started to fail due to this regression:
api/java_util/concurrent/ConcurrentSkipListSet/Stream.html#Stream[checkSubstream]
api/java_util/concurrent/ConcurrentSkipListSet/Stream.html#Stream[checkSubstream2]
api/java_util/concurrent/ConcurrentSkipListSet/ParallelStream.html#ParallelStream[checkSubstream]
api/java_util/concurrent/ConcurrentSkipListSet/ParallelStream.html#ParallelStream[checkSubstream2]
api/java_util/TreeSet/Stream.html#Stream[checkSubstream]
api/java_util/TreeSet/Stream.html#Stream[checkSubstream2]
api/java_util/TreeSet/ParallelStream.html#ParallelStream[checkSubstream]
api/java_util/TreeSet/ParallelStream.html#ParallelStream[checkSubstream2]
api/java_util/TreeMap/KeySetParallelStream.html#KeySetParallelStream[checkSubstream]
api/java_util/TreeMap/KeySetParallelStream.html#KeySetParallelStream[checkSubstream2]
api/java_util/TreeMap/KeySetStream.html#KeySetStream[checkSubstream]
api/java_util/TreeMap/KeySetStream.html#KeySetStream[checkSubstream2]
api/java_util/TreeMap/EntrySetParallelStream.html#KeySetParallelStream[checkSubstream]
api/java_util/TreeMap/EntrySetParallelStream.html#KeySetParallelStream[checkSubstream2]
api/java_util/TreeMap/EntrySetStream.html#KeySetStream[checkSubstream]
api/java_util/TreeMap/EntrySetStream.html#KeySetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetParallelStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetParallelStream[checkSubstream2]
api/java_util/TreeMap/EntrySetParallelStream.html#EntrySetParallelStream[checkSubstream]
api/java_util/TreeMap/EntrySetParallelStream.html#EntrySetParallelStream[checkSubstream2]
api/java_util/TreeMap/EntrySetStream.html#EntrySetStream[checkSubstream]
api/java_util/TreeMap/EntrySetStream.html#EntrySetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetParallelStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetParallelStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueParallelStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueParallelStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueStream[checkSubstream2]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueStream[checkSubstream]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueStream[checkSubstream2]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueParallelStream[checkSubstream]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueParallelStream[checkSubstream2]
the following code:
Stream stream = new TreeSet(Arrays.asList("a", "b")).stream();
Stream substream = stream.substream(1);
Stream parallel = (Stream) substream.parallel();
java.util.Iterator iterator = parallel.iterator();
System.out.println("iterator.hasNext() = " + iterator.hasNext());
System.out.println("iterator.next() = " + iterator.next());
will produce output like:
----------------------------------------
iterator.hasNext() = false
Exception in thread "main" java.util.NoSuchElementException
----------------------------------------
The code works as expected with JDK8b95 main JDK8 binaries producing iterator over a single element "b".
Plenty of JCK tests started to fail due to this regression:
api/java_util/concurrent/ConcurrentSkipListSet/Stream.html#Stream[checkSubstream]
api/java_util/concurrent/ConcurrentSkipListSet/Stream.html#Stream[checkSubstream2]
api/java_util/concurrent/ConcurrentSkipListSet/ParallelStream.html#ParallelStream[checkSubstream]
api/java_util/concurrent/ConcurrentSkipListSet/ParallelStream.html#ParallelStream[checkSubstream2]
api/java_util/TreeSet/Stream.html#Stream[checkSubstream]
api/java_util/TreeSet/Stream.html#Stream[checkSubstream2]
api/java_util/TreeSet/ParallelStream.html#ParallelStream[checkSubstream]
api/java_util/TreeSet/ParallelStream.html#ParallelStream[checkSubstream2]
api/java_util/TreeMap/KeySetParallelStream.html#KeySetParallelStream[checkSubstream]
api/java_util/TreeMap/KeySetParallelStream.html#KeySetParallelStream[checkSubstream2]
api/java_util/TreeMap/KeySetStream.html#KeySetStream[checkSubstream]
api/java_util/TreeMap/KeySetStream.html#KeySetStream[checkSubstream2]
api/java_util/TreeMap/EntrySetParallelStream.html#KeySetParallelStream[checkSubstream]
api/java_util/TreeMap/EntrySetParallelStream.html#KeySetParallelStream[checkSubstream2]
api/java_util/TreeMap/EntrySetStream.html#KeySetStream[checkSubstream]
api/java_util/TreeMap/EntrySetStream.html#KeySetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetParallelStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedSetParallelStream[checkSubstream2]
api/java_util/TreeMap/EntrySetParallelStream.html#EntrySetParallelStream[checkSubstream]
api/java_util/TreeMap/EntrySetParallelStream.html#EntrySetParallelStream[checkSubstream2]
api/java_util/TreeMap/EntrySetStream.html#EntrySetStream[checkSubstream]
api/java_util/TreeMap/EntrySetStream.html#EntrySetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetParallelStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapKeySetParallelStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueParallelStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueParallelStream[checkSubstream2]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueStream[checkSubstream]
api/java_util/Collections/unmodifiable/index.html#UnmodifiableSortedMapValueStream[checkSubstream2]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueStream[checkSubstream]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueStream[checkSubstream2]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueParallelStream[checkSubstream]
api/java_util/Collections/synchronizd/index.html#SynchronizedSortedMapValueParallelStream[checkSubstream2]
Attachments
Issue Links
- relates to
-
JDK-8017631 PriorityQueue.stream().distinct().parallel().iterator() changes the order of elements
- Resolved