What steps will reproduce the problem?
1. Simply compile & run attached standalone class
_____________________________
What is the expected output? What do you see instead?
Expected to load dumped object, but instead got the following exception:
Caused by: org.yaml.snakeyaml.error.YAMLException: Cannot create
property=moreFeatures for JavaBean=DerivedMapTest$MyObject@13a317a;
argument type mismatch
at org.yaml.snakeyaml.constructor.Constructor
$ConstructMapping.constructJavaBean2ndStep(Constructor.java:299)
at org.yaml.snakeyaml.constructor.Constructor
$ConstructMapping.construct(Constructor.java:189)
at org.yaml.snakeyaml.constructor.Constructor
$ConstructYamlObject.construct(Constructor.java:331)
MyObject has two map attributes: features (works fine) and moreFreatures, that
causes the problem because it is of Features type that extends LinkedHashmap
I tried to use a custom constructor, but seems that the result is the
same.
Looks like SnakeYaml whenever recognises a map, creates a linked hash
map and then tries to set the attribute property (that obviously fails).
___________________________
What version of SnakeYAML are you using? On what Java version?
1.11-SNAPSHOT (Maven) on Java 1.6.0_23 & 1.7.0
Original issue reported on code.google.com by graziosi...@gmail.com on 21 Feb 2012 at 11:58
Original issue reported on code.google.com by
graziosi...@gmail.com
on 21 Feb 2012 at 11:58Attachments: