Improve CMS theming.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / LangUtils.java
index 968f8ffe1543335d1126d958d14b092f79d60305..779adb01eb4a204dd2dc07d27bee06be386d6083 100644 (file)
@@ -40,23 +40,23 @@ public class LangUtils {
         */
 
        /**
-        * Creates a new {@link Dictionary} with one key-value pair (neither key not
-        * value should be null)
+        * Creates a new {@link Dictionary} with one key-value pair. Key should not be
+        * null, but if the value is null, it returns an empty {@link Dictionary}.
         */
        public static Dictionary<String, Object> dict(String key, Object value) {
                assert key != null;
-               assert value != null;
                Hashtable<String, Object> props = new Hashtable<>();
-               props.put(key, value);
+               if (value != null)
+                       props.put(key, value);
                return props;
        }
 
-       /**@deprecated Use {@link #dict(String, Object)} instead.*/
+       /** @deprecated Use {@link #dict(String, Object)} instead. */
        @Deprecated
        public static Dictionary<String, Object> dico(String key, Object value) {
                return dict(key, value);
        }
-       
+
        /** Converts a {@link Dictionary} to a {@link Map} of strings. */
        public static Map<String, String> dictToStringMap(Dictionary<String, ?> properties) {
                if (properties == null) {