File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/main/java/com/fasterxml/jackson/core Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2492,12 +2492,12 @@ public void copyCurrentEvent(JsonParser p) throws IOException
2492
2492
case ID_NUMBER_FLOAT :
2493
2493
{
2494
2494
Number n = p .getNumberValueExact ();
2495
- if (n instanceof Float ) {
2496
- writeNumber ((Float ) n );
2497
- } else if (n instanceof BigDecimal ) {
2495
+ if (n instanceof BigDecimal ) {
2498
2496
writeNumber ((BigDecimal ) n );
2499
- } else {
2497
+ } else if ( n instanceof Double ) {
2500
2498
writeNumber (n .doubleValue ());
2499
+ } else {
2500
+ writeNumber (n .floatValue ());
2501
2501
}
2502
2502
break ;
2503
2503
}
@@ -2637,12 +2637,12 @@ protected void _copyCurrentContents(JsonParser p) throws IOException
2637
2637
case ID_NUMBER_FLOAT :
2638
2638
{
2639
2639
Number n = p .getNumberValueExact ();
2640
- if (n instanceof Float ) {
2641
- writeNumber ((Float ) n );
2642
- } else if (n instanceof BigDecimal ) {
2640
+ if (n instanceof BigDecimal ) {
2643
2641
writeNumber ((BigDecimal ) n );
2644
- } else {
2642
+ } else if ( n instanceof Double ) {
2645
2643
writeNumber (n .doubleValue ());
2644
+ } else {
2645
+ writeNumber (n .floatValue ());
2646
2646
}
2647
2647
break ;
2648
2648
}
You can’t perform that action at this time.
0 commit comments