Details
-
Sub-task
-
Resolution: Fixed
-
P2
-
None
-
b103
-
Verified
Description
Consider the following code:
Spliterator<Object> spliterator = Collections.nCopies(0, new Object()).spliterator();
spliterator.tryAdvance((Consumer)null);
spliterator.forEachRemaining((Consumer)null);
The expected NPEs would not be thrown.
The following JCK tests will fail due to this issue:
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[characteristics_ORDERED]
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[forEachRemaining_NPE]
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[hasCharacteristics_ORDERED]
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[tryAdvance_NPE]
api/java_util/Collections/ncopies/index.html#NCopiesStream[checkSpliterator]
api/java_util/Collections/ncopies/index.html#NCopiesParallelStream[checkSpliterator]
Spliterator<Object> spliterator = Collections.nCopies(0, new Object()).spliterator();
spliterator.tryAdvance((Consumer)null);
spliterator.forEachRemaining((Consumer)null);
The expected NPEs would not be thrown.
The following JCK tests will fail due to this issue:
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[characteristics_ORDERED]
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[forEachRemaining_NPE]
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[hasCharacteristics_ORDERED]
api/java_util/Collections/ncopies/index.html#NCopiesSpliteratorEmpty[tryAdvance_NPE]
api/java_util/Collections/ncopies/index.html#NCopiesStream[checkSpliterator]
api/java_util/Collections/ncopies/index.html#NCopiesParallelStream[checkSpliterator]