You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (Resolved) (JIRA)" <ji...@apache.org> on 2012/04/09 20:03:20 UTC

[jira] [Resolved] (COLLECTIONS-391) Inconsistent Javadoc comment and code for toProperties(final Map) in org.apache.commons.collections.MapUtils

     [ https://issues.apache.org/jira/browse/COLLECTIONS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart resolved COLLECTIONS-391.
-----------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0

Thanks for the report. Fixed in r1311359.

The additional constraint about the map parameter has been removed, as the javadoc already states that a null input will result in an empty properties object.
                
> Inconsistent Javadoc comment and code for toProperties(final Map<K, V>) in org.apache.commons.collections.MapUtils
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-391
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-391
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 4.0, 4.x
>         Environment: Platform Indepedent
>            Reporter: SHIN HWEI TAN
>              Labels: javadoc, null
>             Fix For: 4.0
>
>   Original Estimate: 2m
>  Remaining Estimate: 2m
>
> The Javadoc comment below states that the parameter map "..., may not be null":
>    	   /**
> 	    ..
> 	     * @param map  the map to convert to a Properties object, may not be null
> 	     * @return the properties object
> 	     */
> 	    public static <K, V> Properties toProperties(final Map<K, V> map) {
> 	        Properties answer = new Properties();
> 	        if (map != null) {
> 	            ...
> 	        }
> 	        return answer;
> 	    }
> However, the method return normally without throwing any exception when called with null.
> Suggested Fixes:
> 1. Change "@param map  the map to convert to a Properties object, may not be null" to "@param map  the map to convert to a Properties object, may be null"
> or
> 2. Remove "may not be null" from @param.

--
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