File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
smile/src/main/java/com/fasterxml/jackson/dataformat/smile Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -719,13 +719,14 @@ protected final void convertNumberToBigDecimal() throws IOException
719
719
{
720
720
// Note: this MUST start with more accurate representations, since we don't know which
721
721
// value is the original one (others get generated when requested)
722
- if ((_numTypesValid & (NR_DOUBLE | NR_FLOAT )) != 0 ) {
723
- // Let's parse from String representation, to avoid rounding errors that
724
- //non-decimal floating operations would incur
725
- final String text = getText ();
726
- streamReadConstraints ().validateFPLength (text .length ());
727
- _numberBigDecimal = NumberInput .parseBigDecimal (
728
- text , isEnabled (StreamReadFeature .USE_FAST_BIG_NUMBER_PARSER ));
722
+ if ((_numTypesValid & NR_DOUBLE ) != 0 ) {
723
+ // 15-Dec-2023, tatu: Should NOT try to use String representation
724
+ // since we already have decoded into double
725
+ _numberBigDecimal = new BigDecimal (_numberDouble );
726
+ } else if ((_numTypesValid & NR_FLOAT ) != 0 ) {
727
+ // 15-Dec-2023, tatu: Should NOT try to use String representation
728
+ // since we already have decoded into float
729
+ _numberBigDecimal = new BigDecimal (_numberFloat );
729
730
} else if ((_numTypesValid & NR_BIGINT ) != 0 ) {
730
731
_numberBigDecimal = new BigDecimal (_numberBigInt );
731
732
} else if ((_numTypesValid & NR_LONG ) != 0 ) {
You can’t perform that action at this time.
0 commit comments