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

add Map.mergeAll method, default implementation, and overrides in concrete classes

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd_major
    • Component/s: core-libs
    • Labels:

      Description

      Add a new Map.mergeAll(otherMap, remappingFunction) method that merges all the entries of one otherMap into this one, running remappingFunction to merge values of keys that exist in both maps. This is the aggregate version of Map.merge().

        Issue Links

          Activity

          smarks Stuart Marks created issue -
          smarks Stuart Marks made changes -
          Field Original Value New Value
          Status New [ 10000 ] Open [ 1 ]
          psandoz Paul Sandoz made changes -
          Link This issue relates to JDK-8072776 [ JDK-8072776 ]
          smarks Stuart Marks made changes -
          Fix Version/s 9 [ 14949 ]
          smarks Stuart Marks made changes -
          Fix Version/s tbd_major [ 11972 ]
          Fix Version/s 9 [ 14949 ]
          Hide
          smarks Stuart Marks added a comment -
          This would have to be specified very carefully, to allow CHM to implement it without causing an undue burden. For example, this might mean defining mergeAll() to be a succession of merge() calls, while allowing other operations to be interleaved among them.
          Show
          smarks Stuart Marks added a comment - This would have to be specified very carefully, to allow CHM to implement it without causing an undue burden. For example, this might mean defining mergeAll() to be a succession of merge() calls, while allowing other operations to be interleaved among them.
          Hide
          forax Rémi Forax added a comment -
          A bulk operations like putAll on a CHM already allows interleaving.

          From the class overview of CHM,
          "For aggregate operations such as putAll and clear, concurrent retrievals may reflect insertion or removal of only some entries."

          So this semantics seems Ok for mergeAll too.
          Show
          forax Rémi Forax added a comment - A bulk operations like putAll on a CHM already allows interleaving. From the class overview of CHM, "For aggregate operations such as putAll and clear, concurrent retrievals may reflect insertion or removal of only some entries." So this semantics seems Ok for mergeAll too.

            People

            • Assignee:
              smarks Stuart Marks
              Reporter:
              smarks Stuart Marks
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: