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

Empty long/int spliterators produced from empty range streams don't throw NPE for null consumers

XMLWordPrintable

    • b97
    • Verified

      Consider the following code:


              LongStream.range(1, -1).boxed().spliterator().tryAdvance(null);
              LongStream.range(1, -1).asDoubleStream().spliterator().tryAdvance((DoubleConsumer)null);

              IntStream.range(1, -1).boxed().spliterator().tryAdvance(null);
              IntStream.range(1, -1).asDoubleStream().spliterator().tryAdvance((DoubleConsumer)null);
              IntStream.range(1, -1).asLongStream().spliterator().tryAdvance((LongConsumer)null);


      The expected specified NullPointerException will not be thrown.

      The following JCK tests will fail due to this issue:

      api/java_util/stream/IntStream/index.html#Range[checkBoxed]
      api/java_util/stream/IntStream/index.html#Range[checkDoubles]
      api/java_util/stream/IntStream/index.html#Range[checkLongs]
      api/java_util/stream/LongStream/index.html#Range[checkBoxed]
      api/java_util/stream/LongStream/index.html#Range[checkDoubles]


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

              Created:
              Updated:
              Resolved: