Author: tn
Date: Mon May 19 20:37:58 2014
New Revision: 1596050
URL: http://svn.apache.org/r1596050
Log:
[COLLECTIONS-516] Added clarification to javadoc in case of null keys/values.
Thanks to Cyrille Artho.
Modified:
commons/proper/collections/trunk/src/changes/changes.xml
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
Modified: commons/proper/collections/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/changes/changes.xml?rev=1596050&r1=1596049&r2=1596050&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/changes/changes.xml (original)
+++ commons/proper/collections/trunk/src/changes/changes.xml Mon May 19
20:37:58 2014
@@ -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.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java?rev=1596050&r1=1596049&r2=1596050&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
Mon May 19 20:37:58 2014
@@ -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();