From 91c9786e2733559f6caa9608b32a6530912655b1 Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 8 Jun 2023 10:37:46 -0400 Subject: [PATCH] Bump snakeyaml to match spigot, use default ctors. --- worldedit-core/build.gradle.kts | 4 ++-- .../src/main/java/com/sk89q/util/yaml/YAMLProcessor.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index 404e80e39..996d4e153 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -29,7 +29,7 @@ dependencies { constraints { "implementation"( "org.yaml:snakeyaml") { - version { require("1.33") } + version { require("2.0") } because("Bukkit provides SnakeYaml") } } @@ -37,7 +37,7 @@ "api"(project(":worldedit-libs:core")) "compileOnly"("de.schlichtherle:truezip:6.8.4") "implementation"("org.mozilla:rhino-runtime:1.7.13") - "implementation"("org.yaml:snakeyaml:1.33") + "implementation"("org.yaml:snakeyaml:2.0") "implementation"("com.google.guava:guava") "compileOnlyApi"("com.google.code.findbugs:jsr305:1.3.9") "implementation"("com.google.code.gson:gson") diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java index 3d4828962..f6d8a2c83 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java @@ -104,7 +104,7 @@ public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) { // pre-1.32 snakeyaml } - yaml = new Yaml(new SafeConstructor(), representer, dumperOptions, loaderOptions); + yaml = new Yaml(new SafeConstructor(new LoaderOptions()), representer, dumperOptions, loaderOptions); this.file = file; } @@ -308,6 +308,7 @@ public static YAMLNode getEmptyNode(boolean writeDefaults) { private static class FancyRepresenter extends Representer { private FancyRepresenter() { + super(new DumperOptions()); this.nullRepresenter = o -> representScalar(Tag.NULL, ""); } }