YAML serializer generates wrong changesets

Description

Hi all.
I have got a similar issue to CORE-3336, but this time with the YAML format, so with the YAML serializer.

The customChange is serialized like this:

when instead it should be serialized like this:

which gives the following stacktrace:

liquibase.exception.ChangeLogParseException: Error parsing file:///var/folders/jx/fsxw72f978lf1nzjflzb6g_47nv7qh/T/junit1734439134089174889/db.changelog-master.yaml
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:98)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:388)
at AbstractLiquibaseCustomChangeTest.setUp(AbstractLiquibaseCustomChangeTest.java:195)
at SetTechnicalIdsCustomSqlChangeTest.setUp(SetTechnicalIdsCustomSqlChangeTest.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.NullPointerException
at java.util.TreeMap.compare(TreeMap.java:1294)
at java.util.TreeMap.put(TreeMap.java:538)
at java.util.TreeSet.add(TreeSet.java:255)
at liquibase.change.custom.CustomChangeWrapper.setParam(CustomChangeWrapper.java:116)
at liquibase.change.custom.CustomChangeWrapper.customLoadLogic(CustomChangeWrapper.java:315)
at liquibase.change.AbstractChange.load(AbstractChange.java:646)
at liquibase.change.custom.CustomChangeWrapper.load(CustomChangeWrapper.java:297)
at liquibase.changelog.ChangeSet.toChange(ChangeSet.java:441)
at liquibase.changelog.ChangeSet.handleChildNode(ChangeSet.java:380)
at liquibase.changelog.ChangeSet.handleChildNode(ChangeSet.java:377)
at liquibase.changelog.ChangeSet.load(ChangeSet.java:311)
at liquibase.changelog.DatabaseChangeLog.createChangeSet(DatabaseChangeLog.java:513)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:311)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:282)
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:91)
... 39 more

Environment

MacOS 10.13.6
Maven 3.5.2
IntelliJ IDEA 2018.2

Status

Assignee

Unassigned

Reporter

Cosimo Damiano Prete

Labels

None

Affects versions

Priority

Blocker
Configure