feat: changed ObjectMapper to static for the JSON deserializers
This commit is contained in:
parent
65c33d886c
commit
7dcffab0a6
@ -21,7 +21,8 @@ public class EntityDeserializer extends JsonDeserializer<Entity> {
|
||||
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 {
|
||||
|
@ -22,7 +22,8 @@ import java.util.HashMap;
|
||||
|
||||
public class EventDeserializer extends JsonDeserializer<Event> {
|
||||
|
||||
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 {
|
||||
|
@ -13,7 +13,8 @@ import java.io.IOException;
|
||||
|
||||
public class IntVector2Deserializer extends JsonDeserializer<IntVector2> {
|
||||
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user