@@ -30,7 +30,8 @@ of this software and associated documentation files (the "Software"), to deal
3030import java .lang .reflect .Field ;
3131import java .lang .reflect .Method ;
3232import java .lang .reflect .Modifier ;
33- import java .math .*;
33+ import java .math .BigDecimal ;
34+ import java .math .BigInteger ;
3435import java .util .Collection ;
3536import java .util .Enumeration ;
3637import java .util .HashMap ;
@@ -1500,19 +1501,19 @@ public static Object stringToValue(String string) {
15001501 if ((b >= '0' && b <= '9' ) || b == '-' ) {
15011502 try {
15021503 if (string .indexOf ('.' ) > -1 || string .indexOf ('e' ) > -1
1503- || string .indexOf ('E' ) > -1 ) {
1504+ || string .indexOf ('E' ) > -1
1505+ || "0" .equals (string .substring (1 ))) {
15041506 d = Double .valueOf (string );
15051507 if (!d .isInfinite () && !d .isNaN ()) {
15061508 return d ;
15071509 }
15081510 } else {
15091511 Long myLong = new Long (string );
15101512 if (string .equals (myLong .toString ())) {
1511- if (myLong == myLong .intValue ()) {
1512- return myLong .intValue ();
1513- } else {
1514- return myLong ;
1513+ if (myLong .longValue () == myLong .intValue ()) {
1514+ return Integer .valueOf (myLong .intValue ());
15151515 }
1516+ return myLong ;
15161517 }
15171518 }
15181519 } catch (Exception ignore ) {
0 commit comments