[COLLECTIONS-516] Added clarification to javadoc in case of null keys/values. Thanks to Cyrille Artho.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1596050 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2014-05-19 20:37:58 +00:00
parent 527213decc
commit d3d48f8347
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,10 @@
<body>
<release version="4.1" date="TBD" description="">
<action issue="COLLECTIONS-516" dev="tn" type="fix" due-to="Cyrille Artho">
Added clarification to the javadoc of "MapUtils#toProperties(Map)" in case
of null keys/values.
</action>
<action issue="COLLECTIONS-524" dev="tn" type="fix" due-to="J Goodfellow">
"ListOrderedSet#listOrderedSet(List)" did not remove duplicates from the
input list as advertised in the javadoc.

View File

@ -852,11 +852,16 @@ public class MapUtils {
/**
* Gets a new Properties object initialised with the values from a Map.
* A null input will return an empty properties object.
* <p>
* A Properties object may only store non-null keys and values, thus if
* the provided map contains either a key or value which is {@code null},
* a {@link NullPointerException} will be thrown.
*
* @param <K> the key type
* @param <V> the value type
* @param map the map to convert to a Properties object
* @return the properties object
* @throws NullPointerException if a key or value in the provided map is {@code null}
*/
public static <K, V> Properties toProperties(final Map<K, V> map) {
final Properties answer = new Properties();