Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4CFE2200BCA for ; Mon, 7 Nov 2016 00:00:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4B8CC160AE8; Sun, 6 Nov 2016 23:00:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8E250160AFC for ; Sun, 6 Nov 2016 23:59:59 +0100 (CET) Received: (qmail 73793 invoked by uid 500); 6 Nov 2016 22:59:58 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 73772 invoked by uid 99); 6 Nov 2016 22:59:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Nov 2016 22:59:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 539252C0276 for ; Sun, 6 Nov 2016 22:59:58 +0000 (UTC) Date: Sun, 6 Nov 2016 22:59:58 +0000 (UTC) From: "Pierre De Rop (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (FELIX-5400) Can't override default configuration type list value using an empty list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 06 Nov 2016 23:00:00 -0000 [ https://issues.apache.org/jira/browse/FELIX-5400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre De Rop resolved FELIX-5400. ---------------------------------- Resolution: Fixed I think it is resolved. > Can't override default configuration type list value using an empty list > ------------------------------------------------------------------------ > > Key: FELIX-5400 > URL: https://issues.apache.org/jira/browse/FELIX-5400 > 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 List getList() { > return Arrays.asList("a", "b"); > } > } > {code} > So, you can then declare the following values in the actual configuration dictionary for the "list" key: > {code} > list=[a,b] > or > list.0=a > list.1=b > {code} > But assuming that you now want to register in config admin a configuration dictionary with an empty list (you really want an empty list []): then it is not currently possible, because if you don't declare any values for the "list" key, then the default value of the configuration type will be returned (see FELIX5399). > And if you declare the following value for the "list" key: > list=[] > then it does not work too (an empty list won't be returned) because the "toCollection" method in the Configurable.java class calls: > {code} > Arrays.asList(str.split("\\s*,\\s*")) > {code} > which then returns an array of size=1, instead of returning an array of zero size. -- This message was sent by Atlassian JIRA (v6.3.4#6332)