Menu

#46 Problem with store() method in ini4j.jar

v1.0 (example)
open
nobody
None
5
2013-06-17
2013-06-17
No

Hi,
After adding new section to reg file with key and value, using the store() method to save my changes in the file, The section is added in parts more then once.

my code:
File file = new File("2.reg");
Reg reg = new Reg(file);
Key key = reg.add("AA\BB\CC");
key.add("dd","dd");
reg.store();

after the store the file looks like:
[AA]

[AA\BB]

[AA\BB\CC]
"dd"="dd"

If there is key=empty string like: "vv"="", after load the string is changed without the value-> "vv"= and the file cannot be loaded again:
File file = new File("2.reg");
Reg reg = new Reg(file);
Evaluation failed. Reason(s):
An exception occurred: java.lang.StringIndexOutOfBoundsException

please help.
Thanks

Discussion


Log in to post a comment.