Skip to content

Commit 213f722

Browse files
committed
Post-merge tweaks for #4194
1 parent 722edd4 commit 213f722

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

release-notes/VERSION-2.x

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Project: jackson-databind
66

77
2.17.0 (not yet released)
88

9+
#4194: Add `JsonNodeFeature.FAIL_ON_NAN_TO_BIG_DECIMAL_COERCION` option to
10+
fail on attempting to coerce `NaN` into `BigDecimal`
11+
(contributed by Joo-Hyuk K)
912
#4205: Consider types in `sun.*` package(s) to be JDK (platform) types
1013
for purposes of handling
1114
#4209: Make `BeanDeserializerModifier`/`BeanSerializerModifier`

src/test/java/com/fasterxml/jackson/databind/node/NumberNodes1770Test.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@
1010
import com.fasterxml.jackson.databind.*;
1111
import com.fasterxml.jackson.databind.json.JsonMapper;
1212

13-
// Tests for [databind#1770]
13+
// Tests for [databind#1770], [databind#4194]
1414
public class NumberNodes1770Test extends BaseMapTest
1515
{
16-
private final ObjectMapper MAPPER = newJsonMapper();
17-
1816
// For to [databind#1770] (broken due to fix for #1028): `JsonNodeDeserializer`
1917
// would coerce ok but does `parser.isNaN()` check which ends up parsing
2018
// as Double, gets `POSITIVE_INFINITY` and returns `true`: this results in
2119
// `DoubleNode` being used even tho `BigDecimal` could fit the number.
2220
public void testBigDecimalCoercion() throws Exception
2321
{
2422
final String value = "7976931348623157e309";
25-
final JsonNode jsonNode = MAPPER.reader()
23+
final JsonNode jsonNode = newJsonMapper().reader()
2624
.with(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)
2725
.readTree(value);
2826
assertTrue("Expected DecimalNode, got: "+jsonNode.getClass().getName()+": "+jsonNode, jsonNode.isBigDecimal());

0 commit comments

Comments
 (0)