Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
org.apache.felix.dependencymanager-r8
-
None
Description
Assume you are using the following configuration type:
public interface MyConfig { public default SortedMap<String, String> getMap() { SortedMap<String, String> defaultMap = new TreeMap<>(); defaultMap.put("key1", "default1"); defaultMap.put("key2", "default2"); return defaultMap; } }
So, you can then declare the following values in the actual configuration dictionary for the "map" key:
map.key1=value1 map.key2=value2 ... or map={key1.value1, key2.value2}
But assuming that you now want to register in config admin a configuration dictionary with an empty map for the "map" key: it is not currently possible, because if you don't declare any values for the "map" key, then the default value of the configuration type will be returned (see FELIX-5399).
And if you declare the following value for the "map" key:
map={}
then it does not work too because the "toMap" method in the Configurable.java class does not check empty "{}" declaration.