Skip to content

issue with large array size inputs for JavaBigDecimalParser.parseBigDecimal #80

@pjfanning

Description

@pjfanning

This relates to FasterXML/jackson-databind#4694 (comment)

A Jackson user hit an issue with the test case below. The JavaBigDecimalParser.parseBigDecimal call works for the String input but with the char array input, the wrong result is generated. The wrong value is -1.1000E-648.

    @Test
    void issueDatabind4694() {
        final String str = "-11000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
        final BigDecimal expected = new BigDecimal(str);
        assertEquals(expected, JavaBigDecimalParser.parseBigDecimal(str));
        final char[] arr = str.toCharArray();
        assertEquals(expected, JavaBigDecimalParser.parseBigDecimal(arr, 0, arr.length));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions