diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java index f310720b65..337c4c5d90 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java @@ -541,6 +541,7 @@ public class ImportSelectorTests { .collect(Collectors.toMap(entry -> entry.getKey().getClassName(), Map.Entry::getValue)); } + private final List instanceImports = new ArrayList<>(); @Override diff --git a/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java b/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java index 91507fdb24..2a2a501931 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java +++ b/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java @@ -112,7 +112,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple ObjectMapper mapper = getObjectMapper(); boolean forceUseOfBigDecimal = mapper.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS); - if (elementType != null && BigDecimal.class.equals(elementType.getType())) { + if (BigDecimal.class.equals(elementType.getType())) { forceUseOfBigDecimal = true; } @@ -224,6 +224,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple return getMimeTypes(); } + // Jackson2CodecSupport @Override diff --git a/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java b/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java index adccdd8083..7d2e4421ed 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java +++ b/spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java @@ -240,6 +240,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple private ObjectWriter createObjectWriter(ResolvableType valueType, @Nullable MimeType mimeType, @Nullable Map hints) { + JavaType javaType = getJavaType(valueType.getType(), null); Class jsonView = (hints != null ? (Class) hints.get(Jackson2CodecSupport.JSON_VIEW_HINT) : null); ObjectWriter writer = (jsonView != null ?