Distinct operation on an unordered stream should not be a barrier

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: core-libs

      A pipeline such as:

        ThreadLocalRandom.current().ints().boxed().parallel().distinct().findAny();

      will not terminate since distinct() is a barrier for an unordered input.

      In such cases it is possible for the distinct operation to be lazy and use a distinct wrapping spliterator, which internally uses a ConcurrentHashMap to track distinct elements.

            Assignee:
            Paul Sandoz
            Reporter:
            Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: