[
https://issues.apache.org/jira/browse/COLLECTIONS-485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13787206#comment-13787206
]
Hollis Waite commented on COLLECTIONS-485:
------------------------------------------
Ah, I notice that 'Collections.unmodifiableSorted*' also rejects wildcarded
keys. I suppose that it depends on whether interface has any methods that
require a non-wildcarded parameter (e.g. 'SortedSet.tailSet'). Of course, this
constraint can be ignored for methods that would throw
UnsupportedOperationException anyway (e.g. 'add'). Want me to update patch
accordingly?
> Collection copy-constructors should accept wildcarded input
> -----------------------------------------------------------
>
> Key: COLLECTIONS-485
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-485
> Project: Commons Collections
> Issue Type: Improvement
> Components: Bag, BidiMap, Collection, List, Map, Set
> Affects Versions: 4.0-alpha1
> Reporter: Hollis Waite
> Attachments: CaseInsensitiveMap.patch, wildcards.patch
>
>
> Many Collection constructors copy input in order to self-populate. For
> convenience (and consistency with standard Java collections library),
> wildcarded parameters should be accepted where possible. Unmodifiable*
> classes might also benefit from less restrictive generic signatures.
--
This message was sent by Atlassian JIRA
(v6.1#6144)