diff --git a/src/changes/changes.xml b/src/changes/changes.xml index d9c0b4214..b6766a33b 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,10 @@ + + Added clarification to the javadoc of "MapUtils#toProperties(Map)" in case + of null keys/values. + "ListOrderedSet#listOrderedSet(List)" did not remove duplicates from the input list as advertised in the javadoc. diff --git a/src/main/java/org/apache/commons/collections4/MapUtils.java b/src/main/java/org/apache/commons/collections4/MapUtils.java index 788e0dc4f..bfd03d803 100644 --- a/src/main/java/org/apache/commons/collections4/MapUtils.java +++ b/src/main/java/org/apache/commons/collections4/MapUtils.java @@ -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. + *

+ * 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 the key type * @param 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 Properties toProperties(final Map map) { final Properties answer = new Properties();