You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2019/03/07 13:48:00 UTC

[jira] [Commented] (CONFIGURATION-742) Dots in ini keys corrupts nodes structure

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

Gary Gregory commented on CONFIGURATION-742:
--------------------------------------------

[~mjgrzybek],

We welcome patches on GitHub ;)

Gary

> 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
(v7.6.3#76005)