commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COLLECTIONS-504) CompositeMap should support compositing of maps of derived types
Date Wed, 04 Dec 2013 15:33:35 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838982#comment-13838982
] 

Thomas Neidhart commented on COLLECTIONS-504:
---------------------------------------------

What you proposed makes sense, but is not possible atm.

In case you would like to see Immutable collections also in Apache Commons Collections you
could already create a feature request.
I think there are surely use-cases for them and the memory savings can be crucial in various
applications.

> CompositeMap should support compositing of maps of derived types
> ----------------------------------------------------------------
>
>                 Key: COLLECTIONS-504
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-504
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 4.0
>            Reporter: Peter Cooper Jr.
>            Priority: Minor
>
> 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!



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message