Skip to content

Commit 2158410

Browse files
committed
Revert "Support Jackson's DatatypeFeature in Jackson2ObjectMapperBuilder"
This reverts commit 5f05340.
1 parent e0a55c2 commit 2158410

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import com.fasterxml.jackson.databind.ObjectMapper;
4646
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
4747
import com.fasterxml.jackson.databind.SerializationFeature;
48-
import com.fasterxml.jackson.databind.cfg.DatatypeFeature;
4948
import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
5049
import com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair;
5150
import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
@@ -840,9 +839,6 @@ else if (feature instanceof SerializationFeature serializationFeature) {
840839
else if (feature instanceof DeserializationFeature deserializationFeature) {
841840
objectMapper.configure(deserializationFeature, enabled);
842841
}
843-
else if (feature instanceof DatatypeFeature datatypeFeature) {
844-
objectMapper.configure(datatypeFeature, enabled);
845-
}
846842
else if (feature instanceof MapperFeature mapperFeature) {
847843
objectMapper.configure(mapperFeature, enabled);
848844
}

spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilderTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
import com.fasterxml.jackson.databind.SerializerProvider;
5858
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
5959
import com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig;
60-
import com.fasterxml.jackson.databind.cfg.EnumFeature;
61-
import com.fasterxml.jackson.databind.cfg.JsonNodeFeature;
6260
import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig;
6361
import com.fasterxml.jackson.databind.deser.BasicDeserializerFactory;
6462
import com.fasterxml.jackson.databind.deser.Deserializers;
@@ -457,12 +455,10 @@ void completeSetup() throws JsonMappingException {
457455
.annotationIntrospector(current -> AnnotationIntrospector.pair(current, introspector))
458456
.featuresToEnable(SerializationFeature.FAIL_ON_EMPTY_BEANS,
459457
DeserializationFeature.UNWRAP_ROOT_VALUE,
460-
EnumFeature.BOGUS_FEATURE,
461458
JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER,
462459
JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS)
463460
.featuresToDisable(MapperFeature.AUTO_DETECT_GETTERS,
464461
MapperFeature.AUTO_DETECT_FIELDS,
465-
JsonNodeFeature.READ_NULL_PROPERTIES,
466462
JsonParser.Feature.AUTO_CLOSE_SOURCE,
467463
JsonGenerator.Feature.QUOTE_FIELD_NAMES)
468464
.serializationInclusion(JsonInclude.Include.NON_NULL);
@@ -491,15 +487,13 @@ void completeSetup() throws JsonMappingException {
491487

492488
assertThat(mapper.getSerializationConfig().isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS)).isTrue();
493489
assertThat(mapper.getDeserializationConfig().isEnabled(DeserializationFeature.UNWRAP_ROOT_VALUE)).isTrue();
494-
assertThat(mapper.getSerializationConfig().isEnabled(EnumFeature.BOGUS_FEATURE)).isTrue();
495490
assertThat(mapper.getFactory().isEnabled(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER)).isTrue();
496491
assertThat(mapper.getFactory().isEnabled(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS)).isTrue();
497492

498493
assertThat(mapper.getSerializationConfig().isEnabled(MapperFeature.AUTO_DETECT_GETTERS)).isFalse();
499494
assertThat(mapper.getDeserializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION)).isFalse();
500495
assertThat(mapper.getDeserializationConfig().isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)).isFalse();
501496
assertThat(mapper.getDeserializationConfig().isEnabled(MapperFeature.AUTO_DETECT_FIELDS)).isFalse();
502-
assertThat(mapper.getDeserializationConfig().isEnabled(JsonNodeFeature.READ_NULL_PROPERTIES)).isFalse();
503497
assertThat(mapper.getFactory().isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)).isFalse();
504498
assertThat(mapper.getFactory().isEnabled(JsonGenerator.Feature.QUOTE_FIELD_NAMES)).isFalse();
505499
assertThat(mapper.getSerializationConfig().getSerializationInclusion()).isSameAs(JsonInclude.Include.NON_NULL);

0 commit comments

Comments
 (0)