[ https://issues.apache.org/jira/browse/COLLECTIONS-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Neidhart resolved COLLECTIONS-389. ----------------------------------------- Resolution: Fixed Fix Version/s: 4.0 Thanks for the report. It has been fixed in r1311337. I have picked option 1. > Inconsistent Javadoc comment and code for mapTransformer(Map<? super I, ? > extends O>) in org.apache.commons.collections.TransformerUtils > ---------------------------------------------------------------------------------------------------------------------------------------- > > Key: COLLECTIONS-389 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-389 > Project: Commons Collections > Issue Type: Bug > Components: Collection > Affects Versions: 4.0, 4.x > Environment: Platform Independent > Reporter: SHIN HWEI TAN > Labels: javadoc, null > Fix For: 4.0 > > Original Estimate: 2m > Remaining Estimate: 2m > > The Javadoc comment below states that the method "throws > IllegalArgumentException if the map is null": > /** > .... > * @param map the map to use to transform the objects > * @return the transformer > * @throws IllegalArgumentException if the map is null > */ > public static <I, O> Transformer<I, O> mapTransformer(Map<? super > I, ? extends O> map) { > return MapTransformer.mapTransformer(map); > } > However, the method returns a NULL_INSTANCE object instead of throwing > IllegalArgumentException when called with null. > Suggested Fixes: > 1. Change "@throws IllegalArgumentException if the map is null" and "@return" > to "@return NULL_INSTANCE if the map is null". > or > 2. Remove the entire "throws IllegalArgumentException if the map is null". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira