Closed GoogleCodeExporter closed 8 years ago
According to the spec (http://yaml.org/type/int.html) if a number starts with 0
it is considered to be octal.
I tried both version 1.11 and the latest version, everywhere it works properly.
You can try it:
public void testIntInMap() throws Exception {
Yaml yaml = new Yaml();
String doc = "tag: 0000012345\n";
Map<String, Integer> map = (Map<String, Integer>) yaml.load(doc);
int n = map.get("tag").intValue();
assertEquals(5349, n);
}
I am afraid there a problem somewhere in your code.
Please provide a failing test to prove the unexpected conversion from INT to
FLOAT.
Original comment by py4fun@gmail.com
on 23 Apr 2014 at 7:29
Sorry this is not an issue. you are right it correctly converted all strings
with leading 0 to octals.
Original comment by spotha...@gmail.com
on 24 Apr 2014 at 7:10
Original comment by py4fun@gmail.com
on 24 Apr 2014 at 7:12
Original issue reported on code.google.com by
spotha...@gmail.com
on 23 Apr 2014 at 12:49