commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SHIN HWEI TAN (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COLLECTIONS-389) Inconsistent Javadoc comment and code for mapTransformer(Map<? super I, ? extends O>) in org.apache.commons.collections.TransformerUtils
Date Sun, 08 Jan 2012 08:32:39 GMT
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


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

        

Mime
View raw message