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

Add mutability, serializability, and thread-safety, caveat to all Collectors that do not accept a Collection supplier

    Details

      Backports

        Description

        Many of the Collectors defined in java.util.stream.Collectors, that accumulate, group, etc, elements into a Collection, and do not accept a Collection supplier, come with a caveat on the Collection they create, along the lines of, "There are no guarantees on the type, mutability, serializability, or thread-safety of the ... returned".

        This caveat should be applied to all Collectors that create such Collections. This appears to be a minor oversight in the original spec.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  chegar Chris Hegarty
                  Reporter:
                  chegar Chris Hegarty
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: