diff --git a/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/JacksonConfigurationService.java b/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/JacksonConfigurationService.java index 3e02cb2e3..1dc94140a 100644 --- a/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/JacksonConfigurationService.java +++ b/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/JacksonConfigurationService.java @@ -10,7 +10,7 @@ public class JacksonConfigurationService implements ConfigurationService { - private final XMLUtil xmlUtil = new XMLUtil(); + private static final XMLUtil xmlUtil = new XMLUtil(); @Override public Configuration getConfiguration(ManagerParameter parameter) { diff --git a/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/XMLUtil.java b/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/XMLUtil.java index 8f2a8f12a..fa0252a8c 100644 --- a/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/XMLUtil.java +++ b/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/XMLUtil.java @@ -11,7 +11,7 @@ public class XMLUtil { - private final JacksonMapperCreator mapper = new JacksonMapperCreator(); + private static final XmlMapper mapper = new JacksonMapperCreator().create(); /** * Unmarshalls the configuration from the stream. Uses jackson for @@ -22,7 +22,7 @@ public class XMLUtil { */ public Configuration unmarshallConfiguration(InputStream stream) { try { - return mapper.create().readValue(stream, Configuration.class); + return mapper.readValue(stream, Configuration.class); } catch (Exception e) { throw new IllegalStateException("Cannot parse holidays XML file.", e); }