-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
has-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue
Milestone
Description
If the number in JSON cannot be represented as Double and DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
is enabled, big numbers are returned as Infinity.
The test below should pass:
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
final JsonNode jsonNode = objectMapper.readTree("7976931348623157e309");
Assert.assertTrue(jsonNode instanceof NumericNode);
// the following fails with NumberFormatException, because jsonNode is a DoubleNode with a value of POSITIVE_INFINITY
Assert.assertTrue(jsonNode.decimalValue().compareTo(new BigDecimal("7976931348623157e309")) == 0);
The problem is reproducible in the latest released version, 2.9.1.
Metadata
Metadata
Assignees
Labels
has-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue