In my code, the final output can be an "EMPTY" LinkedHashMap (as in.. it was created as new LinkedHashMap<String,Object>() ).
Can the yamlbeans library handle "empty" LinkedHashMap, without throwing Exception?
______________________________________________________________________________
(My code's debug output line): final output is of type java.util.LinkedHashMap
(My code's debug output line): saving the final output= {}
(My code's debug output line): invoking writer.write()
(My code's debug output line): invoking writer.close()
com.esotericsoftware.yamlbeans.YamlException: Error writing YAML.
at com.esotericsoftware.yamlbeans.YamlWriter.writeInternal(YamlWriter.java:100)
at com.esotericsoftware.yamlbeans.YamlWriter.clearAnchors(YamlWriter.java:115)
at com.esotericsoftware.yamlbeans.YamlWriter.close(YamlWriter.java:124)
at org.ASUX.yaml.Cmd.main(Cmd.java:195)
Caused by: com.esotericsoftware.yamlbeans.emitter.EmitterException: Expected no event but found: <document start explicit='false' version='null' tags='null'>
at com.esotericsoftware.yamlbeans.emitter.Emitter$4.expect(Emitter.java:177)
at com.esotericsoftware.yamlbeans.emitter.Emitter.emit(Emitter.java:87)
at com.esotericsoftware.yamlbeans.YamlWriter.writeValue(YamlWriter.java:225)
at com.esotericsoftware.yamlbeans.YamlWriter.writeInternal(YamlWriter.java:97)
... 4 more
____________________________________________________________________________
The only configuration code I have is:-
writer.getConfig().writeConfig.setWriteClassname(YamlConfig.WriteClassName.NEVER);
Also,