(note: somewhat related to #967)
Although we have reasonable protections against direct parsing/decoding of both BigDecimal (as of 2.15 release candidates), regarding "too long" numbers (by textual representation), it appears there may be one performance problem that only occurs if:
- Incoming number is large JSON floating-point number, using scientific notation (i.e. not long textually); decoded internally as
BigDecimal (or double, depending)
- Due to target type being
BigInteger, there is coercion (BigDecimal.toBigInteger())
but if so, performance can deteriorate significantly.
If this turns out to be true, we may need to limit magnitude (scale) of floating-point numbers that are legal to convert; this could be configurable limit (either new value in StreamReadConstraints, or derivative of max number length?) or, possibly just hard-coded value.
(note: somewhat related to #967)
Although we have reasonable protections against direct parsing/decoding of both
BigDecimal(as of 2.15 release candidates), regarding "too long" numbers (by textual representation), it appears there may be one performance problem that only occurs if:BigDecimal(ordouble, depending)BigInteger, there is coercion (BigDecimal.toBigInteger())but if so, performance can deteriorate significantly.
If this turns out to be true, we may need to limit magnitude (scale) of floating-point numbers that are legal to convert; this could be configurable limit (either new value in
StreamReadConstraints, or derivative of max number length?) or, possibly just hard-coded value.