question: public static Number toNumber ( String str , Number defaultValue ) { try { if ( str . indexOf ( '.' ) != - 1 ) { return new BigDecimal ( str ) ; } BigInteger bi = new BigInteger ( str ) ; int l = bi . bitLength ( ) ; if ( l < 32 ) return new Integer ( bi . intValue ( ) ) ; if ( l < 64 ) return new Long ( bi . longValue ( ) ) ; return bi ; } catch ( Throwable t ) { return defaultValue ; } }
target:  returns a number Object, this can be a BigDecimal,BigInteger,Long, Double, depending on the input.