From 0789dd0eb1c6f55e2cc70b9ead98f911b0031b6c Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Mon, 5 Sep 2022 14:30:36 +0200 Subject: [PATCH] Upgrade to SnakeYaml 1.31 Closes gh-32221 --- spring-boot-project/spring-boot-dependencies/build.gradle | 2 +- .../springframework/boot/env/OriginTrackedYamlLoader.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 98bc0debe988..e8c31e039d6b 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1382,7 +1382,7 @@ bom { ] } } - library("SnakeYAML", "1.30") { + library("SnakeYAML", "1.31") { group("org.yaml") { modules = [ "snakeyaml" diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java index a4dc11746a76..f9b194078589 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedYamlLoader.java @@ -75,7 +75,7 @@ private Yaml createYaml(LoaderOptions loaderOptions) { BaseConstructor constructor = new OriginTrackingConstructor(loaderOptions); Representer representer = new Representer(); DumperOptions dumperOptions = new DumperOptions(); - LimitedResolver resolver = new LimitedResolver(); + NoTimestampResolver resolver = new NoTimestampResolver(); return new Yaml(constructor, representer, dumperOptions, loaderOptions, resolver); } @@ -167,14 +167,14 @@ private static Node get(Node node) { /** * {@link Resolver} that limits {@link Tag#TIMESTAMP} tags. */ - private static class LimitedResolver extends Resolver { + private static class NoTimestampResolver extends Resolver { @Override - public void addImplicitResolver(Tag tag, Pattern regexp, String first) { + public void addImplicitResolver(Tag tag, Pattern regexp, String first, int limit) { if (tag == Tag.TIMESTAMP) { return; } - super.addImplicitResolver(tag, regexp, first); + super.addImplicitResolver(tag, regexp, first, limit); } }