Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.10.1
-
None
Description
ini files with empty sections are currently not supported
Properties without a key (e.g. " = worse") can be accessed by a space key. I would suggest to also provide this feature for empty sections:
example emptySection.ini:
[]
property = "property1"
test code:
INIConfiguration iniConfiguration = new INIConfiguration(); try (FileReader fileReader = new FileReader("emptySection.ini")) { iniConfiguration.read(fileReader); } catch (ConfigurationException | IOException e) { e.printStackTrace(); } SubnodeConfiguration subSection = iniConfiguration.getSection(" "); // empty section can be accessed by a space String nextKey = subSection.getKeys().next(); assertNotNull(nextKey); assertEquals("property", nextKey); Object nextValue = subSection.getProperty(nextKey); assertNotNull(nextValue); assertEquals("property1", nextValue);
Attachments
Issue Links
- links to