Browse Source

Polishing

pull/24518/head
Juergen Hoeller 5 years ago
parent
commit
a4179b4795
  1. 1
      spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java
  2. 3
      spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java
  3. 1
      spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java

1
spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java

@ -541,6 +541,7 @@ public class ImportSelectorTests { @@ -541,6 +541,7 @@ public class ImportSelectorTests {
.collect(Collectors.toMap(entry -> entry.getKey().getClassName(),
Map.Entry::getValue));
}
private final List<Entry> instanceImports = new ArrayList<>();
@Override

3
spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java

@ -112,7 +112,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple @@ -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 @@ -224,6 +224,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple
return getMimeTypes();
}
// Jackson2CodecSupport
@Override

1
spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java

@ -240,6 +240,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple @@ -240,6 +240,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
private ObjectWriter createObjectWriter(ResolvableType valueType, @Nullable MimeType mimeType,
@Nullable Map<String, Object> hints) {
JavaType javaType = getJavaType(valueType.getType(), null);
Class<?> jsonView = (hints != null ? (Class<?>) hints.get(Jackson2CodecSupport.JSON_VIEW_HINT) : null);
ObjectWriter writer = (jsonView != null ?

Loading…
Cancel
Save