Skip to content

Commit

Permalink
Use Instance<> instead of @ALL List<> for ObjectMapperProducer
Browse files Browse the repository at this point in the history
This leads to slightly better generated code
(as the generated _Bean does not need to do
reflection on the java member)
  • Loading branch information
geoand committed Jan 8, 2025
1 parent 7a7c37c commit 74a760a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -19,7 +19,7 @@ public class ObjectMapperProducer {
@DefaultBean
@Singleton
@Produces
public ObjectMapper objectMapper(@All List<ObjectMapperCustomizer> customizers) {
public ObjectMapper objectMapper(Instance<ObjectMapperCustomizer> customizers) {
ObjectMapper objectMapper = new ObjectMapper();
List<ObjectMapperCustomizer> sortedCustomizers = sortCustomizersInDescendingPriorityOrder(customizers);
for (ObjectMapperCustomizer customizer : sortedCustomizers) {
Expand Down

0 comments on commit 74a760a

Please sign in to comment.