commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Commented] (COLLECTIONS-485) Collection copy-constructors should accept wildcarded input
Date Sun, 20 Oct 2013 20:22:42 GMT


Thomas Neidhart commented on COLLECTIONS-485:

Hi Hollis,

thanks for your patch, it looks good after a few minor modifications.
Regarding the wildcards, we can only add them in these cases:

 * copy-constructors where the data is really copied
 * decorators /classes that are unmodifiable (do not alter the wrapped collection)

For the special cases of sorted / ordered collections:

 * the key type shall be fixed, whereas the value type may be using a wildcard

> Collection copy-constructors should accept wildcarded input
> -----------------------------------------------------------
>                 Key: COLLECTIONS-485
>                 URL:
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Bag, BidiMap, Collection, List, Map, Set
>    Affects Versions: 4.0-alpha1
>            Reporter: Hollis Waite
>         Attachments: 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

View raw message