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

Define an SPI to plugin new intermediate and terminal stream operations

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • tbd
    • 8, 9
    • core-libs
    • None

    Description

      Define a SPI so that developers can implement their own intermediate and terminal stream operations and apply them to a stream pipeline.

      The Stream interface currently defines a fixed set of intermediate and terminal operations. While it is possible to augment those operations over time with additional operations (such as takeWhile/dropWhile not present in Java 8 that will be present in Java 9) it not possible nor necessary desirable to add specialized operations for particular use-cases.

      Such an SPI is currently difficult to define due to the complexity of supporting reference types and the three primitive types (int, long and double). That complexity is likely to bubble up into an such SPI. With the advent of generics over primitives post Java 9 such an SPI is likely to be simpler (as underlying stream implementation will also be simpler). Thus it is proposed this feature be defined post Java 9 when generics over primitives are supported by the Java platform.

      Attachments

        Issue Links

          Activity

            People

              psandoz Paul Sandoz
              psandoz Paul Sandoz
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: