Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.6, 3.0.7
-
None
-
OS: Mac OS X, Ubuntu 18.04
Groovy versions with exception: 3.x(3.0.7, 3.0.6)
Groovy versions working as expected: 2.5.x(2.5.14, 2.5.8)
JDK versions: Happening in JDK8 and JDK11
Description
Consider the below script, SnakeYaml.groovy
@Grab(group = 'org.yaml', module = 'snakeyaml', version = '1.28') import org.yaml.snakeyaml.DumperOptions import org.yaml.snakeyaml.Yaml def object = [ array: [1, 2] ] DumperOptions dumperOptions = new DumperOptions(defaultFlowStyle: DumperOptions.FlowStyle.BLOCK, indent: 2, width: 200, indentWithIndicator: true, indicatorIndent: 2) println(new Yaml(dumperOptions).dump(object))
When running the below script as groovy SnakeYaml.groovy in groovy 3.x, the below exception is thrown:
Caught: groovy.lang.MissingPropertyException: No such property: indentWithIndicator for class: org.yaml.snakeyaml.DumperOptions groovy.lang.MissingPropertyException: No such property: indentWithIndicator for class: org.yaml.snakeyaml.DumperOptions at SnakeYaml.run(SnakeYaml.groovy:9) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
The same script runs fine in groovy 2.5.x and returns the below output as expected:
array: - 1 - 2