Skip to content

BigInteger parsing in NumberInput can only support '1e10' format when fast parser mode is not used #986

@pjfanning

Description

@pjfanning

NumberInput.parseBigInteger uses BigDecimalParser when the string is large (over 1250 chars). BigDecimalParser can parse nums in '1e10' format and you can convert the BigDecimal to a BigInteger.

When the string size is less than 1250 chars, new BigInteger is used. This will fail for strings in '1e10' format. BigInteger does not support e notation directly.

If you enable FastDoubleParser support, we use its JavaBigIntegerParser regardless of string size. This rejects '1e10' format in order to match the behaviour of BigInteger class.

We should decide whether we want to ban '1e10' format for BigInteger in all cases (which is probably the case in jackson v2.14 and earlier) or if we want to press on and support '1e10' format in all cases. Might be better to ban the format - meaning we could remove the new StreamReadConstraints support for big int scale control.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions