diff --git a/extensions/jackson/deployment/src/test/java/io/quarkus/jackson/deployment/JacksonDefaultPoolTest.java b/extensions/jackson/deployment/src/test/java/io/quarkus/jackson/deployment/JacksonDefaultPoolTest.java new file mode 100644 index 0000000000000..715f9d62ff3ba --- /dev/null +++ b/extensions/jackson/deployment/src/test/java/io/quarkus/jackson/deployment/JacksonDefaultPoolTest.java @@ -0,0 +1,14 @@ +package io.quarkus.jackson.deployment; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; + +import com.fasterxml.jackson.core.util.JsonRecyclerPools; + +public class JacksonDefaultPoolTest { + + @Test + public void validateDefaultJacksonPool() { + Assertions.assertThat(JsonRecyclerPools.defaultPool()).isInstanceOf(JsonRecyclerPools.LockFreePool.class); + } +} diff --git a/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/VertxHybridPoolObjectMapperCustomizer.java b/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/VertxHybridPoolObjectMapperCustomizer.java index 6f7bbe0cd3851..3254837f6e54d 100644 --- a/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/VertxHybridPoolObjectMapperCustomizer.java +++ b/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/VertxHybridPoolObjectMapperCustomizer.java @@ -10,7 +10,9 @@ public class VertxHybridPoolObjectMapperCustomizer implements ObjectMapperCustom @Override public void customize(ObjectMapper objectMapper) { - if (objectMapper.getFactory()._getRecyclerPool() == JsonRecyclerPools.defaultPool()) { + var existingMapperPool = objectMapper.getFactory()._getRecyclerPool(); + // JsonRecyclerPools.defaultPool() by default should create a LockFreePool + if (existingMapperPool instanceof JsonRecyclerPools.LockFreePool) { objectMapper.getFactory().setRecyclerPool(HybridJacksonPool.getInstance()); } }