[ https://issues.apache.org/jira/browse/FELIX-5401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15642590#comment-15642590 ]
Pierre De Rop commented on FELIX-5401: -------------------------------------- Added test in revision 1768402. org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/FELIX5401_OverrideDefaultListConfigTypeWithEmptyMap.java > Can't override default configuration type map value using an empty map > ---------------------------------------------------------------------- > > Key: FELIX-5401 > URL: https://issues.apache.org/jira/browse/FELIX-5401 > Project: Felix > Issue Type: Bug > Components: Dependency Manager > Affects Versions: org.apache.felix.dependencymanager-r8 > Reporter: Pierre De Rop > Assignee: Pierre De Rop > Priority: Minor > Fix For: org.apache.felix.dependencymanager-r9 > > > Assume you are using the following configuration type: > {code} > 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; > } > } > {code} > So, you can then declare the following values in the actual configuration > dictionary for the "map" key: > {code} > map.key1=value1 > map.key2=value2 > ... > or > map={key1.value1, key2.value2} > {code} > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)