You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "SHIN HWEI TAN (Created) (JIRA)" <ji...@apache.org> on 2012/01/08 09:32:39 UTC

[jira] [Created] (COLLECTIONS-390) Inconsistent Javadoc comment and code for mapTransformer(Map) in org.apache.commons.collections.TransformerUtils

Inconsistent Javadoc comment and code for mapTransformer(Map<? super I, ? extends O>) in org.apache.commons.collections.TransformerUtils
----------------------------------------------------------------------------------------------------------------------------------------

                 Key: COLLECTIONS-390
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-390
             Project: Commons Collections
          Issue Type: Bug
          Components: Buffer
    Affects Versions: 4.0-beta-1, 4.0
         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

        

[jira] [Closed] (COLLECTIONS-390) Inconsistent Javadoc comment and code for mapTransformer(Map) in org.apache.commons.collections.TransformerUtils

Posted by "SHIN HWEI TAN (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COLLECTIONS-390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

SHIN HWEI TAN closed COLLECTIONS-390.
-------------------------------------

    Resolution: Duplicate
    
> Inconsistent Javadoc comment and code for mapTransformer(Map<? super I, ? extends O>) in org.apache.commons.collections.TransformerUtils
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-390
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-390
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Buffer
>    Affects Versions: 4.0-beta-1, 4.0
>         Environment: Platform Independent
>            Reporter: SHIN HWEI TAN
>   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