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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

ASF GitHub Bot (Jira)
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

       
Reply | Threaded
Open this post in threaded view
|

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

ASF GitHub Bot (Jira)

     [ 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