Release Note: NPE for empty TreeMap/TreeSet sub-set Spliterator and Stream

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Delivered
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: core-libs

      `Stream.forEach(Consumer<? super T> action)`, `Spliterator.forEachRemaining(Consumer<? super T> action)` and `Spliterator.tryAdvance(Consumer<? super T> action)` specify they throw `NullPointerException` if their argument is `null`. In prior releases, implementations of `Spliterator` and `Stream` for subsets of `TreeMap` and `TreeSet` did not throw `NullPointerException` when passed a null action if the subset was empty. These methods now throw `NullPointerException` when passed a null action for an empty subset instead of returning `false` or completing normally.

            Assignee:
            Oli Gillespie
            Reporter:
            Oli Gillespie
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: