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:38:39 UTC
[jira] [Created] (COLLECTIONS-391) Inconsistent Javadoc comment and
code for toProperties(final Map) in
org.apache.commons.collections.MapUtils
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
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
[jira] [Resolved] (COLLECTIONS-391) Inconsistent Javadoc comment
and code for toProperties(final Map) in
org.apache.commons.collections.MapUtils
Posted by "Thomas Neidhart (Resolved) (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (COLLECTIONS-391) Inconsistent Javadoc comment
and code for toProperties(final Map) in
org.apache.commons.collections.MapUtils
Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250052#comment-13250052 ]
Hudson commented on COLLECTIONS-391:
------------------------------------
Integrated in commons-collections #17 (See [https://builds.apache.org/job/commons-collections/17/])
[COLLECTIONS-391] Fixed javadoc, thanks to Shin Hwei Tan. (Revision 1311359)
Result = SUCCESS
tn : http://svn.apache.org/viewvc/?view=rev&rev=1311359
Files :
* /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/MapUtils.java
> 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