@@ -16,7 +16,6 @@ import org.snakeyaml.engine.v2.events.SequenceStartEvent
1616import org.snakeyaml.engine.v2.events.StreamEndEvent
1717import org.snakeyaml.engine.v2.events.StreamStartEvent
1818import java.io.StringWriter
19- import java.util.Optional
2019
2120internal fun Any.toYaml (): String {
2221 val settings =
@@ -33,7 +32,7 @@ internal fun Any.toYaml(): String {
3332 }
3433 val emitter = Emitter (settings, writer)
3534 emitter.emit(StreamStartEvent ())
36- emitter.emit(DocumentStartEvent (false , Optional .empty() , emptyMap()))
35+ emitter.emit(DocumentStartEvent (false , null , emptyMap()))
3736
3837 this .elementToYaml(emitter)
3938
@@ -52,14 +51,14 @@ private fun Any?.elementToYaml(emitter: Emitter) {
5251}
5352
5453private fun Map <* , * >.mapToYaml (emitter : Emitter ) {
55- emitter.emit(MappingStartEvent (Optional .empty(), Optional .empty() , true , FlowStyle .BLOCK ))
54+ emitter.emit(MappingStartEvent (null , null , true , FlowStyle .BLOCK ))
5655
5756 this .forEach { (key, value) ->
5857 // key
5958 emitter.emit(
6059 ScalarEvent (
61- Optional .empty() ,
62- Optional .empty() ,
60+ null ,
61+ null ,
6362 ImplicitTuple (true , true ),
6463 key.toString(),
6564 ScalarStyle .PLAIN ,
@@ -73,7 +72,7 @@ private fun Map<*, *>.mapToYaml(emitter: Emitter) {
7372}
7473
7574private fun List <* >.listToYaml (emitter : Emitter ) {
76- emitter.emit(SequenceStartEvent (Optional .empty(), Optional .empty() , true , FlowStyle .BLOCK ))
75+ emitter.emit(SequenceStartEvent (null , null , true , FlowStyle .BLOCK ))
7776
7877 this .forEach { value ->
7978 value.elementToYaml(emitter)
@@ -94,6 +93,6 @@ private fun Any?.scalarToYaml(emitter: Emitter) {
9493 ScalarStyle .PLAIN
9594 }
9695 emitter.emit(
97- ScalarEvent (Optional .empty(), Optional .empty() , ImplicitTuple (true , true ), this .toString(), scalarStyle),
96+ ScalarEvent (null , null , ImplicitTuple (true , true ), this .toString(), scalarStyle),
9897 )
9998}
0 commit comments