From cba807b22f0e9d5bd13056b989e8da6c57320edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 1 Mar 2023 13:58:31 +0100 Subject: [PATCH] Fix upgrade --- .../java/org/mapfish/print/config/ConfigurationFactory.java | 6 +----- .../org/mapfish/print/config/MapfishPrintConstructor.java | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/mapfish/print/config/ConfigurationFactory.java b/core/src/main/java/org/mapfish/print/config/ConfigurationFactory.java index 817ff53ac8..c20ff5c196 100644 --- a/core/src/main/java/org/mapfish/print/config/ConfigurationFactory.java +++ b/core/src/main/java/org/mapfish/print/config/ConfigurationFactory.java @@ -44,12 +44,8 @@ public final void init() { if (maxAliases != null) { loaderOptions.setMaxAliasesForCollections(Integer.parseInt(maxAliases)); } - Representer representer = new Representer(); DumperOptions dumperOptions = new DumperOptions(); - dumperOptions.setDefaultFlowStyle(representer.getDefaultFlowStyle()); - dumperOptions.setDefaultScalarStyle(representer.getDefaultScalarStyle()); - dumperOptions.setAllowReadOnlyProperties(representer.getPropertyUtils().isAllowReadOnlyProperties()); - dumperOptions.setTimeZone(representer.getTimeZone()); + Representer representer = new Representer(dumperOptions); this.yaml = new Yaml(constructor, representer, dumperOptions, loaderOptions); } diff --git a/core/src/main/java/org/mapfish/print/config/MapfishPrintConstructor.java b/core/src/main/java/org/mapfish/print/config/MapfishPrintConstructor.java index 409d948eb5..6319c3fd69 100644 --- a/core/src/main/java/org/mapfish/print/config/MapfishPrintConstructor.java +++ b/core/src/main/java/org/mapfish/print/config/MapfishPrintConstructor.java @@ -4,6 +4,7 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.ConfigurableApplicationContext; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.nodes.Node; @@ -34,7 +35,7 @@ public final class MapfishPrintConstructor extends Constructor { * @param context the application context object for creating */ public MapfishPrintConstructor(final ConfigurableApplicationContext context) { - super(new TypeDescription(Configuration.class, CONFIGURATION_TAG)); + super(new TypeDescription(Configuration.class, CONFIGURATION_TAG), new LoaderOptions()); this.context = context; Map yamlObjects = context.getBeansOfType(ConfigurationObject.class); for (Map.Entry entry: yamlObjects.entrySet()) {