commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <>
Subject [jira] [Resolved] (LANG-819) EnumUtils.generateBitVector needs a "? extends"
Date Thu, 24 Oct 2013 20:54:05 GMT


Matt Benson resolved LANG-819.

    Resolution: Won't Fix

None of these examples convince me.  If enums were extensible I could accept your argument.
 If the parameter were {{Collection}} instead of {{Iterable}} I could accept your argument.
 "Just because a bunch of other superficially similar methods look this way" does not seem,
to me, to justify changing the method signature for no discernible benefit.  Feel free to
reopen if you can provide a working example of (somewhat, at least) sensible code that would
be possible with this change and is not possible without it.


> EnumUtils.generateBitVector needs a "? extends"
> -----------------------------------------------
>                 Key: LANG-819
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.0.1
>            Reporter: Shevek
>            Priority: Minor
>             Fix For: Review Patch
>     public static <E extends Enum<E>> long generateBitVector(Class<E>
enumClass, Iterable<E> values) {
> Should be Iterable<? extends E>.
> This is because although no subclasses of E can exist, the "? extends" is a common idiom
for marking the collection as readonly, or not "owned" by the current object.

This message was sent by Atlassian JIRA

View raw message