[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:
parent
527213decc
commit
d3d48f8347
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue