UcasRichard / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
0 stars 0 forks source link

Error in dump/load on some dates #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Run the following code:

  Date someDate = new DateMidnight(1,1,21).toDate();
  Yaml yaml = new Yaml();
  String s = yaml.dump(someDate);
  System.out.println(s);
  Object o = yaml.load(s);
  assert o.equals(someDate);

Produces the following exception

Exception in thread "main" org.yaml.snakeyaml.error.YAMLException: Unexpected 
timestamp: 1-01-23T03:06:28Z
    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlTimestamp.construct(SafeConstructor.java:303)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:181)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:140)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:126)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:296)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:266)
    at cobol2any.Test.main(Test.java:38)

Original issue reported on code.google.com by cjalme...@gmail.com on 18 Feb 2011 at 7:30

GoogleCodeExporter commented 9 years ago
Fixed in:
http://code.google.com/p/snakeyaml/source/detail?r=38bdcad501c198de9188e9ea043c8
12bd9ed3dbe

The fix will be delivered in release 1.9

Thank you.

Original comment by py4fun@gmail.com on 18 Feb 2011 at 11:52

GoogleCodeExporter commented 9 years ago
Issue 119 has been merged into this issue.

Original comment by alexande...@gmail.com on 3 Jun 2011 at 5:43