Closed GoogleCodeExporter closed 9 years ago
Thank you.
This is in fact not a bug but a feature request. Because {} are not used for
the leaf
bean SnakeYAML tries to construct a scalar. Since there is no single-argument
(the
empty String as the argument) constructor it fails. Nevertheless this is an
interesting
case. I will think how we can improve the implementation.
Original comment by py4fun@gmail.com
on 24 Jul 2009 at 9:13
Question: if a Java instance is created out of following YAML document:
"!!com.package.Name" and 2 constructors are present in the Name class:
no-argument
constructor and with a String argument which constructor shall be used and why ?
Current situation:
"!!com.package.Name {}" - empty constructor is called
"!!com.package.Name" - constructor with an empty String is called
Original comment by py4fun@gmail.com
on 27 Jul 2009 at 8:42
[deleted comment]
[deleted comment]
[deleted comment]
[deleted comment]
Fixed.
Take the latest source and check:
`http://code.google.com/p/snakeyaml/source/browse/src/test/java/org/yaml/snakeya
ml/issu
es/issue9/NopropTest.java`
The support is done via a custom Constructor (BeanConstructor). We need that
because
there is more then 1 way to create an instance.
Original comment by py4fun@gmail.com
on 5 Aug 2009 at 7:54
Original comment by aso...@gmail.com
on 6 Aug 2009 at 10:00
Original issue reported on code.google.com by
wwagn...@gmail.com
on 22 Jul 2009 at 7:53Attachments: