Skip to content

Commit e90d9e6

Browse files
garyrussellartembilan
authored andcommitted
Upgrade to Jackson 2.10
- one deprecated method replaced by `JsonBuilder.configure(...)`. * 2.10 GA
1 parent 594d005 commit e90d9e6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ext {
4141
googleJsr305Version = '3.0.2'
4242
hamcrestVersion = '2.1'
4343
hibernateValidationVersion = '6.0.17.Final'
44-
jacksonVersion = '2.9.9.20190807'
44+
jacksonVersion = '2.10.0'
4545
jaywayJsonPathVersion = '2.4.0'
4646
junit4Version = '4.12'
4747
junitJupiterVersion = '5.5.2'

spring-kafka/src/main/java/org/springframework/kafka/support/JacksonUtils.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.fasterxml.jackson.databind.MapperFeature;
2424
import com.fasterxml.jackson.databind.Module;
2525
import com.fasterxml.jackson.databind.ObjectMapper;
26+
import com.fasterxml.jackson.databind.json.JsonMapper;
2627

2728
/**
2829
* The utilities for Jackson {@link ObjectMapper} instances.
@@ -54,9 +55,10 @@ public static ObjectMapper enhancedObjectMapper() {
5455
* @return the {@link ObjectMapper} instance.
5556
*/
5657
public static ObjectMapper enhancedObjectMapper(ClassLoader classLoader) {
57-
ObjectMapper objectMapper = new ObjectMapper();
58-
objectMapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false);
59-
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
58+
ObjectMapper objectMapper = JsonMapper.builder()
59+
.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false)
60+
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
61+
.build();
6062
registerWellKnownModulesIfAvailable(objectMapper, classLoader);
6163
return objectMapper;
6264
}

0 commit comments

Comments
 (0)