[ 
https://issues.apache.org/jira/browse/CONFIGURATION-401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776513#action_12776513
 ] 

Ralph Goers commented on CONFIGURATION-401:
-------------------------------------------

If your customer mandates property files then I don't understand how 
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

would be acceptable. java.util.Properties files do not allow duplicate keys. 
Instead, you would have to do

persons.person.name=1,4,7
persons.person,surName=2,5,8
persons.persona.phoneNum=3,6,9

which, of course, is practically useless.

Also, I don't think I've actually seen a description of why you need to convert 
the properties into a hierarchical format. What is the use case you are trying 
to solve?

Yes, we could invent some new syntax that might work, but I don't think any of 
the committers are interested in doing that. I don't believe any of us are 
directly paid to work on Commons Configuration and we all have other things we 
would like to work on.

That said, although I understand you said you don't have the resources to do 
it, if you, or someone else, were to provide a patch we would definitely 
consider it.

> 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.

Reply via email to