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

Yuji Konishi commented on CONFIGURATION-742:
--------------------------------------------

As "." is a delimiter, it is converted to "..".
(DefaultConfigurationKey.escapeDelimiters())

configParser.getSection("dots_example").containsKey("......")
// return true

See, TestINIConfiguration.testGetSectionsDottedVar()


> Dots in ini keys corrupts nodes structure
> -----------------------------------------
>
>                 Key: CONFIGURATION-742
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-742
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Expression engine
>    Affects Versions: 1.6
>            Reporter: Michal Grzybek
>            Priority: Major
>
> Example:
> {noformat}
> [dots_example]
> ...
> # only key, no value on purpose {noformat}
> Dots as key names are [considered as syntax 
> error|http://commons.apache.org/proper/commons-configuration/userguide/howto_hierarchical.html#Escaping_special_characters]
>  but no ConfigurationException is thrown and also this property is stored in 
> data structure as a node with key="..." and value=null.
> This leads to problems:
>  
> {{configParser.getSection("dots_example").getRootNode().getChildren()}}
> // returns Collection with one Node: "..."=null
> {{configParser.getSection("dots_example").getKeys()}}
> // returns List size=1 with "..." inside
>  
> but
> {{configParser.getSection("dots_example").containsKey("...")}}
> // return false
>  
> The result of inconsistent data structure is e.g. NPE when writing to file.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to