From 2d3c47360f4cbfc24f1c13c14613e494cee764fc Mon Sep 17 00:00:00 2001 From: Robert Yokota Date: Tue, 11 Jun 2024 08:42:29 -0700 Subject: [PATCH] Revert "do not reinstantiate objectmapper as it's expensive (#2686) (#2695)" This reverts commit ed122412c7eebc3cb737dcce5a713b94b1893568. --- .../serializers/json/AbstractKafkaJsonSchemaDeserializer.java | 2 +- .../serializers/json/AbstractKafkaJsonSchemaSerializer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaDeserializer.java b/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaDeserializer.java index 9e74dbc9210..11b2f84635b 100644 --- a/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaDeserializer.java +++ b/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaDeserializer.java @@ -42,7 +42,7 @@ import io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe; public abstract class AbstractKafkaJsonSchemaDeserializer extends AbstractKafkaSchemaSerDe { - protected static final ObjectMapper objectMapper = Jackson.newObjectMapper(); + protected ObjectMapper objectMapper = Jackson.newObjectMapper(); protected Class type; protected String typeProperty; protected boolean validate; diff --git a/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaSerializer.java b/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaSerializer.java index a97a4eec2bf..09e497a0251 100644 --- a/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaSerializer.java +++ b/json-schema-serializer/src/main/java/io/confluent/kafka/serializers/json/AbstractKafkaJsonSchemaSerializer.java @@ -41,7 +41,7 @@ public abstract class AbstractKafkaJsonSchemaSerializer extends AbstractKafka protected boolean autoRegisterSchema; protected boolean useLatestVersion; protected boolean latestCompatStrict; - protected static final ObjectMapper objectMapper = Jackson.newObjectMapper(); + protected ObjectMapper objectMapper = Jackson.newObjectMapper(); protected SpecificationVersion specVersion; protected boolean oneofForNullables; protected boolean failUnknownProperties;