You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ryan Fox (JIRA)" <ji...@apache.org> on 2015/03/05 00:49:38 UTC
[jira] [Updated] (CONFIGURATION-597) Periods in INI file keys not
parsed correctly
[ https://issues.apache.org/jira/browse/CONFIGURATION-597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan Fox updated CONFIGURATION-597:
-----------------------------------
Description:
I am using HierarchicalINIConfiguration. When I try to parse an INI file with periods in the key definitions, something goes wrong, and the periods are parsed incorrectly. For example, my INI file looks like
[foods]
breakfast.drink=oj
lunch.drink=milk
dinner.drink=beer
And my java code looks like
File configFile = new File("path/to/the/file.ini");
HierarchicalINIConfiguration config = new HierarchichalINIConfiguration(configFile);
config.getSection("foods").getString("breakfast.drink", null); // null
config.getSection("foods").getString("breakfast..drink", null); // "oj"
Note the double period in the second one. Is this something I'm doing wrong, or is there a bug in the parser? Are periods such as this even allowed in INI files? I can't find anything explicitly saying either way.
was:
I am using HierarchicalINIConfiguration. When I try to parse an INI file with periods in the key definitions, something goes wrong, and the periods are parsed incorrectly. For example, my INI file looks like
[foods]
breakfast.drink=oj
lunch.drink=milk
dinner.drink=beer
And my java code looks like
File configFile = new File("path/to/the/file.ini");
HierarchicalINIConfiguration config = new HierarchichalINIConfiguration(configFile);
config.getSection("foods").getString("breakfast.drink", null); // null
config.getSection("foods").getString("breakfast..drink", null); // "oj"
Note the double period in the second one. Is this something I'm doing wrong, or is there a bug in the parser? Are periods such as this even allowed in INI files? I can't find anything explicitly saying either way.
> Periods in INI file keys not parsed correctly
> ---------------------------------------------
>
> Key: CONFIGURATION-597
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-597
> Project: Commons Configuration
> Issue Type: Bug
> Affects Versions: 1.10
> Reporter: Ryan Fox
> Priority: Minor
>
> I am using HierarchicalINIConfiguration. When I try to parse an INI file with periods in the key definitions, something goes wrong, and the periods are parsed incorrectly. For example, my INI file looks like
> [foods]
> breakfast.drink=oj
> lunch.drink=milk
> dinner.drink=beer
> And my java code looks like
> File configFile = new File("path/to/the/file.ini");
> HierarchicalINIConfiguration config = new HierarchichalINIConfiguration(configFile);
> config.getSection("foods").getString("breakfast.drink", null); // null
> config.getSection("foods").getString("breakfast..drink", null); // "oj"
> Note the double period in the second one. Is this something I'm doing wrong, or is there a bug in the parser? Are periods such as this even allowed in INI files? I can't find anything explicitly saying either way.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)