From 74a760a49a2902cf3612c897f8826e0385a8e7a6 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 8 Jan 2025 16:33:51 +0200 Subject: [PATCH] Use Instance<> instead of @All List<> for ObjectMapperProducer This leads to slightly better generated code (as the generated _Bean does not need to do reflection on the java member) --- .../java/io/quarkus/jackson/runtime/ObjectMapperProducer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/ObjectMapperProducer.java b/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/ObjectMapperProducer.java index 3d94e94feb5b7..e91bf55337136 100644 --- a/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/ObjectMapperProducer.java +++ b/extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/ObjectMapperProducer.java @@ -5,12 +5,12 @@ import java.util.List; import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Instance; import jakarta.enterprise.inject.Produces; import jakarta.inject.Singleton; import com.fasterxml.jackson.databind.ObjectMapper; -import io.quarkus.arc.All; import io.quarkus.arc.DefaultBean; import io.quarkus.jackson.ObjectMapperCustomizer; @@ -19,7 +19,7 @@ public class ObjectMapperProducer { @DefaultBean @Singleton @Produces - public ObjectMapper objectMapper(@All List customizers) { + public ObjectMapper objectMapper(Instance customizers) { ObjectMapper objectMapper = new ObjectMapper(); List sortedCustomizers = sortCustomizersInDescendingPriorityOrder(customizers); for (ObjectMapperCustomizer customizer : sortedCustomizers) {