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 2011/10/26 22:23:32 UTC
[jira] [Created] (COLLECTIONS-384) Inconsistent Javadoc comment and
code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
---------------------------------------------------------------------------------------------------------
Key: COLLECTIONS-384
URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
Project: Commons Collections
Issue Type: Bug
Components: Collection
Affects Versions: 3.2, 3.1, 3.0
Environment: Platform independent
Reporter: SHIN HWEI TAN
Priority: Minor
The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
/**
...
* @param map the map to synchronize, must not be null
* @return a synchronized map backed by the given map
* @throws IllegalArgumentException if the map is null
*/
public static Map synchronizedMap(Map map) {
return Collections.synchronizedMap(map);
}
However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
Suggested Fixes:
1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
or
2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
or
3. 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] [Updated] (COLLECTIONS-384) Inconsistent Javadoc comment and
code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
Posted by "SHIN HWEI TAN (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
SHIN HWEI TAN updated COLLECTIONS-384:
--------------------------------------
Priority: Major (was: Critical)
> Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
> ---------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-384
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection
> Affects Versions: 3.0, 3.1, 3.2
> Environment: Platform independent
> Reporter: SHIN HWEI TAN
> Labels: code, javadoc, synchronizedMap
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
> /**
> ...
> * @param map the map to synchronize, must not be null
> * @return a synchronized map backed by the given map
> * @throws IllegalArgumentException if the map is null
> */
> public static Map synchronizedMap(Map map) {
> return Collections.synchronizedMap(map);
> }
> However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
> Suggested Fixes:
> 1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
> or
> 2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
> or
> 3. 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] [Updated] (COLLECTIONS-384) Inconsistent Javadoc comment and
code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Neidhart updated COLLECTIONS-384:
----------------------------------------
Fix Version/s: 4.0
> Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
> ---------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-384
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection
> Affects Versions: 3.0, 3.1, 3.2
> Environment: Platform independent
> Reporter: SHIN HWEI TAN
> Labels: code, javadoc, synchronizedMap
> Fix For: 4.0
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
> /**
> ...
> * @param map the map to synchronize, must not be null
> * @return a synchronized map backed by the given map
> * @throws IllegalArgumentException if the map is null
> */
> public static Map synchronizedMap(Map map) {
> return Collections.synchronizedMap(map);
> }
> However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
> Suggested Fixes:
> 1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
> or
> 2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
> or
> 3. 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] [Updated] (COLLECTIONS-384) Inconsistent Javadoc comment and
code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
Posted by "SHIN HWEI TAN (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
SHIN HWEI TAN updated COLLECTIONS-384:
--------------------------------------
Priority: Critical (was: Minor)
> Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
> ---------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-384
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection
> Affects Versions: 3.0, 3.1, 3.2
> Environment: Platform independent
> Reporter: SHIN HWEI TAN
> Priority: Critical
> Labels: code, javadoc, synchronizedMap
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
> /**
> ...
> * @param map the map to synchronize, must not be null
> * @return a synchronized map backed by the given map
> * @throws IllegalArgumentException if the map is null
> */
> public static Map synchronizedMap(Map map) {
> return Collections.synchronizedMap(map);
> }
> However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
> Suggested Fixes:
> 1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
> or
> 2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
> or
> 3. 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] [Commented] (COLLECTIONS-384) Inconsistent Javadoc comment
and code for synchronizedMap(Map) in
org.apache.commons.collections.MapUtils
Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139436#comment-13139436 ]
Gary D. Gregory commented on COLLECTIONS-384:
---------------------------------------------
I picked option (3) because {{Collections.synchronizedMap(map);}} says nothing on the topic so I do not think it should be part of our contract.
In fact our method seems superfluus. Why use it instead of Collections.synchronizedMap(map)?
> Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
> ---------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-384
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection
> Affects Versions: 3.0, 3.1, 3.2
> Environment: Platform independent
> Reporter: SHIN HWEI TAN
> Labels: code, javadoc, synchronizedMap
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
> /**
> ...
> * @param map the map to synchronize, must not be null
> * @return a synchronized map backed by the given map
> * @throws IllegalArgumentException if the map is null
> */
> public static Map synchronizedMap(Map map) {
> return Collections.synchronizedMap(map);
> }
> However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
> Suggested Fixes:
> 1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
> or
> 2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
> or
> 3. 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] [Resolved] (COLLECTIONS-384) Inconsistent Javadoc comment
and code for synchronizedMap(Map) in
org.apache.commons.collections.MapUtils
Posted by "Gary D. Gregory (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory resolved COLLECTIONS-384.
-----------------------------------------
Resolution: Fixed
Committed revision 1195031.
> Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
> ---------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-384
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection
> Affects Versions: 3.0, 3.1, 3.2
> Environment: Platform independent
> Reporter: SHIN HWEI TAN
> Labels: code, javadoc, synchronizedMap
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
> /**
> ...
> * @param map the map to synchronize, must not be null
> * @return a synchronized map backed by the given map
> * @throws IllegalArgumentException if the map is null
> */
> public static Map synchronizedMap(Map map) {
> return Collections.synchronizedMap(map);
> }
> However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
> Suggested Fixes:
> 1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
> or
> 2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
> or
> 3. 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] [Commented] (COLLECTIONS-384) Inconsistent Javadoc comment
and code for synchronizedMap(Map) in
org.apache.commons.collections.MapUtils
Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139439#comment-13139439 ]
Hudson commented on COLLECTIONS-384:
------------------------------------
Integrated in commons-collections #2 (See [https://builds.apache.org/job/commons-collections/2/])
[COLLECTIONS-384] Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils.
ggregory : http://svn.apache.org/viewvc/?view=rev&rev=1195031
Files :
* /commons/proper/collections/trunk/src/java/org/apache/commons/collections/MapUtils.java
> Inconsistent Javadoc comment and code for synchronizedMap(Map) in org.apache.commons.collections.MapUtils
> ---------------------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-384
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-384
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection
> Affects Versions: 3.0, 3.1, 3.2
> Environment: Platform independent
> Reporter: SHIN HWEI TAN
> Labels: code, javadoc, synchronizedMap
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if the map is null":
> /**
> ...
> * @param map the map to synchronize, must not be null
> * @return a synchronized map backed by the given map
> * @throws IllegalArgumentException if the map is null
> */
> public static Map synchronizedMap(Map map) {
> return Collections.synchronizedMap(map);
> }
> However, the method throws NullPointerException instead of IllegalArgumentException when called with null.
> Suggested Fixes:
> 1. Add code "if (map == null) throw IllegalArgumentException();" at the beginning of the method body.
> or
> 2. Change "@throws IllegalArgumentException if the map is null" to "@throws NullPointerException if the map is null".
> or
> 3. 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