File tree 2 files changed +5
-4
lines changed
src/test/java/com/fasterxml/jackson/databind/node
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ Project: jackson-databind
6
6
7
7
2.17.0 (not yet released)
8
8
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)
9
12
#4205 : Consider types in `sun.*` package(s) to be JDK (platform) types
10
13
for purposes of handling
11
14
#4209 : Make `BeanDeserializerModifier`/`BeanSerializerModifier`
Original file line number Diff line number Diff line change 10
10
import com .fasterxml .jackson .databind .*;
11
11
import com .fasterxml .jackson .databind .json .JsonMapper ;
12
12
13
- // Tests for [databind#1770]
13
+ // Tests for [databind#1770], [databind#4194]
14
14
public class NumberNodes1770Test extends BaseMapTest
15
15
{
16
- private final ObjectMapper MAPPER = newJsonMapper ();
17
-
18
16
// For to [databind#1770] (broken due to fix for #1028): `JsonNodeDeserializer`
19
17
// would coerce ok but does `parser.isNaN()` check which ends up parsing
20
18
// as Double, gets `POSITIVE_INFINITY` and returns `true`: this results in
21
19
// `DoubleNode` being used even tho `BigDecimal` could fit the number.
22
20
public void testBigDecimalCoercion () throws Exception
23
21
{
24
22
final String value = "7976931348623157e309" ;
25
- final JsonNode jsonNode = MAPPER .reader ()
23
+ final JsonNode jsonNode = newJsonMapper () .reader ()
26
24
.with (DeserializationFeature .USE_BIG_DECIMAL_FOR_FLOATS )
27
25
.readTree (value );
28
26
assertTrue ("Expected DecimalNode, got: " +jsonNode .getClass ().getName ()+": " +jsonNode , jsonNode .isBigDecimal ());
You can’t perform that action at this time.
0 commit comments