UcasRichard / snakeyaml

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

Enums with overridden toString() will not round-trip #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Attempt to serialize an Enum that has a non-standard toString() method. The 
toString() output will appear in the dumped YAML. In general, this makes it 
impossible to round-trip data. Instead, SnakeYaml should dump the Enum's name 
property. See 
http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Enum.html#name()

A patch is attached.

Original issue reported on code.google.com by JordanAn...@gmail.com on 15 Feb 2011 at 11:08

Attachments:

GoogleCodeExporter commented 9 years ago
nice finding. I'll apply the patch

Original comment by alexande...@gmail.com on 16 Feb 2011 at 7:41

GoogleCodeExporter commented 9 years ago
only sad thing - it didn't make it into 1.8 release :)

Original comment by alexande...@gmail.com on 16 Feb 2011 at 7:42

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 2dfcecd246.

Original comment by JordanAn...@gmail.com on 16 Feb 2011 at 7:43

GoogleCodeExporter commented 9 years ago
The 1.9-SNAPSHOT has been updated

Original comment by py4fun@gmail.com on 16 Feb 2011 at 9:20