From bdac416a62d2ccb373745171229477c244b00689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 16 Nov 2022 11:47:50 +0100 Subject: [PATCH] Refine BackgroundPreinitializer Jackson initialization AllEncompassingFormHttpMessageConverter already initializes Jackson ObjectMapper. This commit updates BackgroundPreinitializer in order to not run JacksonInitializer when MessageConverterInitializer already takes care of initializing ObjectMapper. See gh-33220 --- .../boot/autoconfigure/BackgroundPreinitializer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index 523bebab48..6acf7e53d4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -34,6 +34,7 @@ import org.springframework.core.annotation.Order; import org.springframework.format.support.DefaultFormattingConversionService; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; +import org.springframework.util.ClassUtils; /** * {@link ApplicationListener} to trigger early initialization in a background thread of @@ -100,8 +101,14 @@ public class BackgroundPreinitializer implements ApplicationListener