@@ -589,30 +589,30 @@ protected final void convertNumberToInt() throws IOException
589
589
// Let's verify it's lossless conversion by simple roundtrip
590
590
int result = (int ) _numberLong ;
591
591
if (((long ) result ) != _numberLong ) {
592
- _reportError ( "Numeric value (%s) out of range of int" , getText ( ));
592
+ reportOverflowInt ( String . valueOf ( _numberLong ));
593
593
}
594
594
_numberInt = result ;
595
595
} else if ((_numTypesValid & NR_BIGINT ) != 0 ) {
596
596
if (BI_MIN_INT .compareTo (_numberBigInt ) > 0
597
597
|| BI_MAX_INT .compareTo (_numberBigInt ) < 0 ) {
598
- reportOverflowInt ();
598
+ reportOverflowInt (String . valueOf ( _numberBigInt ) );
599
599
}
600
600
_numberInt = _numberBigInt .intValue ();
601
601
} else if ((_numTypesValid & NR_DOUBLE ) != 0 ) {
602
602
// Need to check boundaries
603
603
if (_numberDouble < MIN_INT_D || _numberDouble > MAX_INT_D ) {
604
- reportOverflowInt ();
604
+ reportOverflowInt (String . valueOf ( _numberDouble ) );
605
605
}
606
606
_numberInt = (int ) _numberDouble ;
607
607
} else if ((_numTypesValid & NR_FLOAT ) != 0 ) {
608
608
if (_numberFloat < MIN_INT_D || _numberFloat > MAX_INT_D ) {
609
- reportOverflowInt ();
609
+ reportOverflowInt (String . valueOf ( _numberFloat ) );
610
610
}
611
611
_numberInt = (int ) _numberFloat ;
612
612
} else if ((_numTypesValid & NR_BIGDECIMAL ) != 0 ) {
613
613
if (BD_MIN_INT .compareTo (_numberBigDecimal ) > 0
614
614
|| BD_MAX_INT .compareTo (_numberBigDecimal ) < 0 ) {
615
- reportOverflowInt ();
615
+ reportOverflowInt (String . valueOf ( _numberBigDecimal ) );
616
616
}
617
617
_numberInt = _numberBigDecimal .intValue ();
618
618
} else {
@@ -629,23 +629,23 @@ protected final void convertNumberToLong() throws IOException
629
629
} else if ((v & NR_BIGINT ) != 0 ) {
630
630
if (BI_MIN_LONG .compareTo (_numberBigInt ) > 0
631
631
|| BI_MAX_LONG .compareTo (_numberBigInt ) < 0 ) {
632
- reportOverflowLong ();
632
+ reportOverflowLong (String . valueOf ( _numberBigInt ) );
633
633
}
634
634
_numberLong = _numberBigInt .longValue ();
635
635
} else if ((v & NR_DOUBLE ) != 0 ) {
636
636
if (_numberDouble < MIN_LONG_D || _numberDouble > MAX_LONG_D ) {
637
- reportOverflowLong ();
637
+ reportOverflowLong (String . valueOf ( _numberDouble ) );
638
638
}
639
639
_numberLong = (long ) _numberDouble ;
640
640
} else if ((v & NR_FLOAT ) != 0 ) {
641
641
if (_numberFloat < MIN_LONG_D || _numberFloat > MAX_LONG_D ) {
642
- reportOverflowInt ( );
642
+ reportOverflowLong ( String . valueOf ( _numberFloat ) );
643
643
}
644
644
_numberLong = (long ) _numberFloat ;
645
645
} else if ((v & NR_BIGDECIMAL ) != 0 ) {
646
646
if (BD_MIN_LONG .compareTo (_numberBigDecimal ) > 0
647
647
|| BD_MAX_LONG .compareTo (_numberBigDecimal ) < 0 ) {
648
- reportOverflowLong ();
648
+ reportOverflowLong (String . valueOf ( _numberBigDecimal ) );
649
649
}
650
650
_numberLong = _numberBigDecimal .longValue ();
651
651
} else {
0 commit comments