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

The Streams API is in desperate need of folding operations

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      Use the Streams API to do a folding operation is hampered by the burden of the current reduce(), collect(), et al having to support parallel streams via the Collector combiner() method. Versions of Collector that don't have the combiner function requirement would make writing folding operations possible without relying on current JDK implementations only using the combiner for parallel streams.

      The alternative is unpleasant. You must declare some kind of collector outside of the stream chain of calls which gets passed to forEachOrdered() and then, separately, is used to extract the final value. A quick search of SO will show developer's frustration at this missing functionality in Streams.


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: