Documentation for Stream.reduce should mention that commutative is also required

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 8u25
    • Component/s: core-libs

      A DESCRIPTION OF THE PROBLEM :
      Stream.reduce should also note that the binary operation needs to be commutative as well as associative. Consider a stream of 2 by 2 matrices using matrix multiplication. This is associative (and their is an identity) but if run from a parallel stream the answer could vary.


      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/8/docs/api/

            Assignee:
            Stuart Marks
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: