The following generates a null pointer exception:
--- !jyaml.Klass1
double1: !java.lang.Double 0.0010
list1:
- |
index1-line1
index1-line2
string1: thisIsAString
string2: thisIsAnotherString
and this does not:
--- !jyaml.Klass1
double1: !java.lang.Double 0.0010
list1:
- index1
- |
index2-line1
index2-line2
string1: thisIsAString
string2: thisIsAnotherString
Attached source files demonstrate the problem in jyaml 1.3
npe stack trace:
java.lang.NullPointerException
at org.ho.yaml.ReflectionUtil.getPropertyDescriptor(Unknown Source)
at org.ho.yaml.ReflectionUtil.hasProperty(Unknown Source)
at org.ho.yaml.wrapper.DefaultBeanWrapper.getPropertyType(Unknown Source)
at org.ho.yaml.wrapper.DefaultBeanWrapper.getExpectedType(Unknown Source)
at org.ho.yaml.MapState.expectedType(Unknown Source)
at org.ho.yaml.State.createWrapper(Unknown Source)
at org.ho.yaml.State.openList(Unknown Source)
at org.ho.yaml.State.nextOnEvent(Unknown Source)
at org.ho.yaml.MapState.nextOnEvent(Unknown Source)
at org.ho.yaml.JYamlParserEvent.event(Unknown Source)
at yaml.parser.YamlParser.sendEvents(Unknown Source)
at yaml.parser.YamlParser.value_block(Unknown Source)
at yaml.parser.YamlParser.value(Unknown Source)
at yaml.parser.YamlParser.nlist_entry(Unknown Source)
at yaml.parser.YamlParser.nlist(Unknown Source)
at yaml.parser.YamlParser.value_nested(Unknown Source)
at yaml.parser.YamlParser.loose_value(Unknown Source)
at yaml.parser.YamlParser.nmap_entry(Unknown Source)
at yaml.parser.YamlParser.nmap(Unknown Source)
at yaml.parser.YamlParser.value_nested(Unknown Source)
at yaml.parser.YamlParser.value_na(Unknown Source)
at org.ho.yaml.YamlDecoder.firstDocument(Unknown Source)
at org.ho.yaml.YamlDecoder.readObject(Unknown Source)
at org.ho.yaml.YamlDecoder$Stream.peek(Unknown Source)
at org.ho.yaml.YamlDecoder$Stream.<init>(Unknown Source)
at org.ho.yaml.YamlDecoder.asStream(Unknown Source)
at org.ho.yaml.YamlConfig.loadStream(Unknown Source)
at org.ho.yaml.YamlConfig.loadStream(Unknown Source)
at org.ho.yaml.YamlConfig.loadStream(Unknown Source)
at org.ho.yaml.Yaml.loadStream(Unknown Source)
at jyaml.Main.npe(Main.java:46)
at jyaml.Main.main(Main.java:28)
jyaml/Main.java;jyaml/Klass1.java