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

Spliterator from an empty boxed primitive streams doesn't throw NPE for null consumers

XMLWordPrintable

      The problem is similar to JDK-8019479, the following code

              LongStream.empty().boxed().spliterator().tryAdvance((Consumer)null);
              LongStream.empty().boxed().spliterator().forEachRemaining((Consumer)null);

              IntStream.empty().boxed().spliterator().tryAdvance((Consumer)null);
              IntStream.empty().boxed().spliterator().forEachRemaining((Consumer) null);

              DoubleStream.empty().boxed().spliterator().tryAdvance((Consumer)null);
              DoubleStream.empty().boxed().spliterator().forEachRemaining((Consumer) null);


      would not throw anything.

      The following JCK tests will fail due to this:

      api/java_util/stream/DoubleStream/Empty.html#Empty[checkBoxed]
      api/java_util/stream/IntStream/Empty.html#Empty[checkBoxed]
      api/java_util/stream/IntStream/Empty.html#Empty[checkDoubles]
      api/java_util/stream/IntStream/Empty.html#Empty[checkLongs]
      api/java_util/stream/LongStream/Empty.html#Empty[checkBoxed]
      api/java_util/stream/LongStream/Empty.html#Empty[checkDoubles]
      api/java_util/stream/IntStream/index.html#RangeClosedEmptyResult[checkBoxed]
      api/java_util/stream/IntStream/index.html#RangeClosedEmptyResult[checkDoubles]
      api/java_util/stream/IntStream/index.html#RangeClosedEmptyResult[checkLongs]
      api/java_util/stream/IntStream/index.html#RangeEmptyResult[checkBoxed]
      api/java_util/stream/IntStream/index.html#RangeEmptyResult[checkDoubles]
      api/java_util/stream/IntStream/index.html#RangeEmptyResult[checkLongs]
      api/java_util/stream/LongStream/index.html#RangeClosedEmptyResult[checkBoxed]
      api/java_util/stream/LongStream/index.html#RangeClosedEmptyResult[checkDoubles]
      api/java_util/stream/LongStream/index.html#RangeEmptyResult[checkBoxed]
      api/java_util/stream/LongStream/index.html#RangeEmptyResult[checkDoubles]


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

              Created:
              Updated:
              Resolved: