diff --git a/CHANGES.md b/CHANGES.md index 20674bca..4344deb4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,5 +8,6 @@ Apollo Java 2.2.0 [refactor(apollo-client): Optimize the exception message when failing to retrieve configuration information.](https://github.com/apolloconfig/apollo-java/pull/22) [Add JUnit5 extension support for apollo mock server.](https://github.com/apolloconfig/apollo-java/pull/25) [Support concurrent loading of Config for different namespaces.](https://github.com/apolloconfig/apollo-java/pull/31) +[Fix snakeyaml 2.x compatibility issues](https://github.com/apolloconfig/apollo-java/pull/35) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo-java/milestone/2?closed=1) \ No newline at end of file diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java index 5b98233f..00a681e7 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java @@ -67,7 +67,9 @@ public void process(Properties properties, Map map) { private Yaml createYaml() { LoaderOptions loadingConfig = new LoaderOptions(); loadingConfig.setAllowDuplicateKeys(false); - return new Yaml(new SafeConstructor(), new Representer(), new DumperOptions(), loadingConfig); + DumperOptions dumperOptions = new DumperOptions(); + return new Yaml(new SafeConstructor(loadingConfig), + new Representer(dumperOptions), dumperOptions, loadingConfig); } private boolean process(MatchCallback callback, Yaml yaml, String content) {