Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3ADFC18FA9 for ; Thu, 21 Jan 2016 04:19:40 +0000 (UTC) Received: (qmail 79396 invoked by uid 500); 21 Jan 2016 04:19:40 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 79323 invoked by uid 500); 21 Jan 2016 04:19:40 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 79311 invoked by uid 99); 21 Jan 2016 04:19:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2016 04:19:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C3D7A2C1F55 for ; Thu, 21 Jan 2016 04:19:39 +0000 (UTC) Date: Thu, 21 Jan 2016 04:19:39 +0000 (UTC) From: "Tran Thanh Phuong (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CONFIGURATION-616) Issue about ListHandler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CONFIGURATION-616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15110016#comment-15110016 ] Tran Thanh Phuong commented on CONFIGURATION-616: ------------------------------------------------- I tested again with 2 simpler scenarios: + Only one plain xml configuration file. + CombinedConfiguration with 2 xml files(not nested like the case I reported). Unfortunately, I can not reproduce this issue with 2 scenarios above. It works like a charm in such both cases. So, I think this is the problem of CombinedConfiguration when we have nested configuration files. In my project, we have vast configuration, so, we need to separate them for easier to manage. On the other hand, we need one xml file to wrap all other configuration files together. > Issue about ListHandler > ----------------------- > > Key: CONFIGURATION-616 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-616 > Project: Commons Configuration > Issue Type: Bug > Components: Build, Expression engine > Affects Versions: 2.0-alpha1 > Reporter: Tran Thanh Phuong > Fix For: 2.0 > > > This issue can be easily reproduced! > Create a configuration files like this: > config.xml: > {code:xml} > > > > > > {code} > {code:xml} > > > #FF0000, #00FF00 > > {code} > Java code: > {code:java} > DefaultExpressionEngineSymbols symbols = new DefaultExpressionEngineSymbols.Builder( > DefaultExpressionEngineSymbols.DEFAULT_SYMBOLS) > // Use a slash as property delimiter instead of dot > .setPropertyDelimiter("/").create(); > DefaultExpressionEngine engine = new DefaultExpressionEngine(symbols); > // Now create a configuration using this expression engine > Parameters params = new Parameters(); > DefaultListDelimiterHandler listDelimiterHandler = new DefaultListDelimiterHandler(','); > XMLBuilderParameters xmlBuilderParameters = params.xml() .setFileName("config.xml").setExpressionEngine(engine) .setListDelimiterHandler(listDelimiterHandler); > dcb = new CombinedConfigurationBuilder().configure(xmlBuilderParameters); > try { > config = dcb.getConfiguration(); > } catch (ConfigurationException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > {code} > I could not retrieving values of colors.pie using: > config.getStringArray("colors.pie"); > The result is a single string "#FF0000, #00FF00" instead of an array of Strings. > However, using Java code to add a new property like this: > config.addProperty("my.test.value", "#FF0000, #00FF00"), > I can get an array as the result of : > config.getStringArray("my.test.value"); -- This message was sent by Atlassian JIRA (v6.3.4#6332)