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

Document Three argument reduction method in stream api - comma missing

    XMLWordPrintable

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      The provided snippet for 3 argument reduce method in the stream api,
      The below snippet comma is missing.
      Comma should come before Integer::sum

        int sumOfWeights = widgets.stream()
                                     .reduce(0,
                                             (sum, b) -> sum + b.getWeight())
                                             Integer::sum);


        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: