From 31c1460e5edde808c2fd4d83304dd53510fbd28c Mon Sep 17 00:00:00 2001 From: Damian Minkov <damencho@jitsi.org> Date: Wed, 5 Sep 2012 14:29:22 +0000 Subject: [PATCH] Configuration service skips empty key names. --- .../impl/configuration/SortedProperties.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/org/jitsi/impl/configuration/SortedProperties.java b/src/org/jitsi/impl/configuration/SortedProperties.java index 98c82711..8859c039 100644 --- a/src/org/jitsi/impl/configuration/SortedProperties.java +++ b/src/org/jitsi/impl/configuration/SortedProperties.java @@ -48,4 +48,23 @@ public Object nextElement() } }; } + + /** + * Do not allow putting empty String keys in the properties table. + * @param key the key + * @param value the value + * @return the previous value of the specified key in this hashtable, + * or <code>null</code> if it did not have one + */ + public synchronized Object put(Object key, Object value) + { + if(key instanceof String + && ((String)key).trim().length() == 0) + { + // just skip the putting + return null; + } + + return super.put(key, value); + } } -- GitLab