Skip to content

Commit

Permalink
Polish SnakeYAML 2.0 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
bclozel committed May 22, 2023
1 parent 097758b commit 40543e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
* Note that the value of "foo" in the first document is not simply replaced
* with the value in the second, but its nested values are merged.
*
* <p>Requires SnakeYAML 1.18 or higher, as of Spring Framework 5.0.6.
* <p>Requires SnakeYAML 2.0 or higher, as of Spring Framework 6.1.0.
*
* @author Dave Syer
* @author Juergen Hoeller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.composer.ComposerException;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.inspector.TagInspector;
import org.yaml.snakeyaml.nodes.Tag;
Expand All @@ -49,7 +50,7 @@
/**
* Base class for YAML factories.
*
* <p>Requires SnakeYAML 1.18 or higher, as of Spring Framework 5.0.6.
* <p>Requires SnakeYAML 2.0 or higher, as of Spring Framework 6.1.0.
*
* @author Dave Syer
* @author Juergen Hoeller
Expand Down Expand Up @@ -134,7 +135,7 @@ public void setResources(Resource... resources) {
* <p>If no supported types are configured, only Java standard classes
* (as defined in {@link org.yaml.snakeyaml.constructor.SafeConstructor})
* encountered in YAML documents will be supported.
* If an unsupported type is encountered, an {@link IllegalStateException}
* If an unsupported type is encountered, an {@link ComposerException}
* will be thrown when the corresponding YAML node is processed.
* @param supportedTypes the supported types, or an empty array to clear the
* supported types
Expand Down Expand Up @@ -175,12 +176,12 @@ protected void process(MatchCallback callback) {
/**
* Create the {@link Yaml} instance to use.
* <p>The default implementation sets the "allowDuplicateKeys" flag to {@code false},
* enabling built-in duplicate key handling in SnakeYAML 1.18+.
* <p>As of Spring Framework 5.1.16, if custom {@linkplain #setSupportedTypes
* supported types} have been configured, the default implementation creates
* a {@code Yaml} instance that filters out unsupported types encountered in
* YAML documents. If an unsupported type is encountered, an
* {@link IllegalStateException} will be thrown when the node is processed.
* enabling built-in duplicate key handling.
* <p>If custom {@linkplain #setSupportedTypes supported types} have been configured,
* the default implementation creates a {@code Yaml} instance that filters out
* unsupported types encountered in YAML documents.
* If an unsupported type is encountered, an {@link ComposerException} will be
* thrown when the node is processed.
* @see LoaderOptions#setAllowDuplicateKeys(boolean)
*/
protected Yaml createYaml() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -74,7 +74,7 @@
* servers[1]=foo.bar.com
* </pre>
*
* <p>Requires SnakeYAML 1.18 or higher, as of Spring Framework 5.0.6.
* <p>Requires SnakeYAML 2.0 or higher, as of Spring Framework 6.1.0.
*
* @author Dave Syer
* @author Stephane Nicoll
Expand Down

0 comments on commit 40543e0

Please sign in to comment.