[ https://issues.apache.org/jira/browse/LANG-819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13863140#comment-13863140 ]
Matt Benson commented on LANG-819: ---------------------------------- I am sorry to contribute to anyone's impatience with Apache; however, let's take this one step at a time. You said: {quote} My caller wants a static assertion that the (parent) routine will not modify the collection {quote} I think by this you mean: {quote} My \[consuming code\] wants a \[compile-time\] assertion that the \[{{EnumUtils#generateBitVector()}}\] routine will not modify the collection {quote} How does declaring the parameter as {{Iterable}}, even if it were raw, not satisfy that requirement? (Once you cast to any other type, all bets are off anyway.) > EnumUtils.generateBitVector needs a "? extends" > ----------------------------------------------- > > Key: LANG-819 > URL: https://issues.apache.org/jira/browse/LANG-819 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 3.0.1 > Reporter: Shevek > Priority: Minor > > 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 (v6.1.5#6160)