Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 94708 invoked from network); 10 Nov 2009 19:25:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 19:25:54 -0000 Received: (qmail 90758 invoked by uid 500); 10 Nov 2009 19:25:53 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 90249 invoked by uid 500); 10 Nov 2009 19:25:52 -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 90060 invoked by uid 99); 10 Nov 2009 19:25:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 19:25:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 19:25:49 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3B183234C4AB for ; Tue, 10 Nov 2009 11:25:28 -0800 (PST) Message-ID: <764537140.1257881128240.JavaMail.jira@brutus> Date: Tue, 10 Nov 2009 19:25:28 +0000 (UTC) From: "Oliver Heger (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (CONFIGURATION-401) HierarchicalConfiguration does not support hierarchy from property files In-Reply-To: <1676176538.1257691952515.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CONFIGURATION-401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776026#action_12776026 ] Oliver Heger commented on CONFIGURATION-401: -------------------------------------------- In your special example the {{PropertiesConfiguration}} contains 3 keys: _persons.person.name_, _persons.person.surName_, and _persons.person.phoneNum_. Each key is associated with a list of values. In this concrete case it is possible to convert this data into a hierarchical structure. But as soon as the structure becomes slightly more complex, you are lost. Consider the example where persons are organized in groups, and you have properties like {code} persons.group.name=admins persons.person.name=x persons.person.name=y persons.group.name=users persons.person.name=z {code} Here you have two groups and three persons, but after the properties are read into a {{PropertiesConfiguration}} how do you know which persons belong to which group? You try to extract structure from a format that is simply not provided. > HierarchicalConfiguration does not support hierarchy from property files > ------------------------------------------------------------------------- > > Key: CONFIGURATION-401 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-401 > Project: Commons Configuration > Issue Type: Bug > Components: Expression engine > Affects Versions: 1.6 > Environment: windows/Linux > Reporter: yair ogen > > If you have hierarchy like this: > persons.person.name=1 > persons.person.surName=2 > persons.person.phoneNum=3 > persons.person.name=4 > persons.person.surName=5 > persons.person.phoneNum=6 > persons.person.name=7 > persons.person.surName=8 > persons.person.phoneNum=9 > If I have a regular property configuration that loaded a file containing in the above. then I transform into HierarchicalConfiguration using: ConfigurationUtils.convertToHierarchical(configuration). > The tree is not right. > I can do this: > hierarchicalConfiguration.subset("persons").subset("person(0)").getKeys() > but this returned empty iterator: > hierarchicalConfiguration.subset("persons").subset("person(1)").getKeys() > Only the first person is available. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.