An empty spliterator taken from Stream.builder() doesn't throw NPE for null consumers

XMLWordPrintable

      Both spliterator's methods

       - forEachRemaining()
       - tryAdvance()

      specify
       
       "throws NullPointerException if the specified action is null"

      This doesn't happen for a spliterator produced as below:

              Stream.builder().build().spliterator().forEachRemaining((Consumer)null);
              Stream.builder().build().spliterator().tryAdvance((Consumer)null);


      The following test JCK will fail due to this issue

      api/java_util/stream/Stream/Builder.html#Builder[checkSpliterator]

            Assignee:
            Paul Sandoz
            Reporter:
            Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: