Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8153293

Preserve SORTED and DISTINCT characteristics for boxed() and asLongStream() operations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-libs
    • None

      Currently IntStream.boxed(), LongStream.boxed(), DoubleStream.boxed() operations remove SORTED and DISTINCT flags, though in fact these operations do preserve them. This is especially important as distinct() for primitive streams is implemented like "boxed().distinct().unbox" where boxed() kills the flags which could be used for distinct() optimization.

      Similarly IntStream.asLongStream() unnecessarily remove SORTED and DISTINCT flags. IntStream.asDoubleStream() and LongStream.asDoubleStream() also could preserve SORTED (but not DISTINCT, at least for LongStream.asDoubleStream()).

            tvaleev Tagir Valeev
            tvaleev Tagir Valeev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: