Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-504

CompositeMap should support compositing of maps of derived types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 4.0
    • None
    • Map
    • None

    Description

      I'm attempting to composite two maps, one of which is a Map<String, String> and the other of which is a Map<String, Object>. I would have expected that I could composite them into a CompositeMap<String, Object>, but the constructors of CompositeMap expect all of the maps being composited to have exactly the same type arguments.

      That is, I think the constructors should take arguments of Map<? extends K, ? extends V> instead of what they currently have of Map<K, V>, much like most collection methods, since there shouldn't be a problem accepting type arguments that are subtypes of the composite map types.

      Thanks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            petercooperjr-efi Peter Cooper Jr.
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: