diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EntityDeserializer.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EntityDeserializer.java index 6830f70..1c9b9a8 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EntityDeserializer.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EntityDeserializer.java @@ -21,7 +21,8 @@ public class EntityDeserializer extends JsonDeserializer { Rock } - private final ObjectMapper mapper = new ObjectMapper(); + // static so that no reinitializations are needed + private static final ObjectMapper mapper = new ObjectMapper(); @Override public Entity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializer.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializer.java index dd33762..a288cc1 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializer.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/EventDeserializer.java @@ -22,7 +22,8 @@ import java.util.HashMap; public class EventDeserializer extends JsonDeserializer { - private final ObjectMapper mapper = new ObjectMapper(); + // static so that no reinitializations are needed + private static final ObjectMapper mapper = new ObjectMapper(); @Override public Event deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java index 5741a9c..a01af72 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java @@ -13,7 +13,8 @@ import java.io.IOException; public class IntVector2Deserializer extends JsonDeserializer { - ObjectMapper mapper = new ObjectMapper(); + // static so that no reinitializations are needed + private static final ObjectMapper mapper = new ObjectMapper(); @Override public IntVector2 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {