From 58eddb8fa495739e1cc756a234babb0a7662d923 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 5 Sep 2019 17:13:45 +0100 Subject: [PATCH] Become compatible with Jackson 2.10 while remaining 2.9 compatible See gh-17999 --- .../properties/ConfigurationPropertiesReportEndpoint.java | 1 + .../java/org/springframework/boot/json/JacksonJsonParser.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index 5961b2c874..0a70be4447 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -165,6 +165,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext protected void configureObjectMapper(ObjectMapper mapper) { mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); + mapper.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false); mapper.configure(MapperFeature.USE_STD_BEAN_NAMING, true); mapper.setSerializationInclusion(Include.NON_NULL); applyConfigurationPropertiesFilter(mapper); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java index 508062dd35..97a14c10c2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java @@ -31,9 +31,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; */ public class JacksonJsonParser extends AbstractJsonParser { - private static final TypeReference MAP_TYPE = new MapTypeReference(); + private static final MapTypeReference MAP_TYPE = new MapTypeReference(); - private static final TypeReference LIST_TYPE = new ListTypeReference(); + private static final ListTypeReference LIST_TYPE = new ListTypeReference(); private ObjectMapper objectMapper; // Late binding