aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/Context.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/Context.java')
-rw-r--r--src/main/java/org/traccar/Context.java17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/main/java/org/traccar/Context.java b/src/main/java/org/traccar/Context.java
index 68a711878..54bb2af4b 100644
--- a/src/main/java/org/traccar/Context.java
+++ b/src/main/java/org/traccar/Context.java
@@ -16,7 +16,6 @@
package org.traccar;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.BaseObjectManager;
@@ -29,7 +28,6 @@ import org.traccar.database.PermissionsManager;
import org.traccar.database.UsersManager;
import org.traccar.geocoder.Geocoder;
import org.traccar.helper.Log;
-import org.traccar.helper.SanitizerModule;
import org.traccar.model.BaseModel;
import org.traccar.model.Device;
import org.traccar.model.Group;
@@ -55,12 +53,6 @@ public final class Context {
return config;
}
- private static ObjectMapper objectMapper;
-
- public static ObjectMapper getObjectMapper() {
- return objectMapper;
- }
-
private static IdentityManager identityManager;
public static IdentityManager getIdentityManager() {
@@ -119,7 +111,7 @@ public final class Context {
@Override
public ObjectMapper getContext(Class<?> clazz) {
- return objectMapper;
+ return Main.getInjector().getInstance(ObjectMapper.class);
}
}
@@ -135,13 +127,6 @@ public final class Context {
throw e;
}
- objectMapper = new ObjectMapper();
- if (config.getBoolean(Keys.WEB_SANITIZE)) {
- objectMapper.registerModule(new SanitizerModule());
- }
- objectMapper.setConfig(
- objectMapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
-
client = ClientBuilder.newClient().register(new ObjectMapperContextResolver());
if (config.hasKey(Keys.DATABASE_URL)) {