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

Wrong return type in code sample in Collector API documentation

    Details

    • Subcomponent:
    • Resolved In Build:
      b18
    • Verification:
      Not verified

      Description

      A DESCRIPTION OF THE PROBLEM :
      https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collector.html

      Interface Collector<T,A,R>

      API Note:
          Performing a reduction operation with a Collector should produce a result equivalent to:


               R container = collector.supplier().get();
               for (T t : data)
                   collector.accumulator().accept(container, t);
               return collector.finisher().apply(container);
           
      MUST BE:
             A container = collector.supplier().get();


      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              jboes Julia Boes
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: