Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8020146 JCK issues for java.util.stream
  3. JDK-8020016

Numerous splitereator impls do not throw NPE for null Consumers

    XMLWordPrintable

Details

    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]




      Attachments

        Activity

          People

            psandoz Paul Sandoz
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: