Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
When user set the invalid formatted value to BigDecimal, exception deosn't retrun in 1.3.1 and former versions. Besides, the return value depends on each version. REPRODUCE: 1) Compile the attached test program.(BigDecimalTest.java) 2) Launch "java BigDecimalTest" EXPECTED VS ACTUAL BEHAVIOR: The test program specifies new BigDecimal("--6") and the followings are the result in each version. Expected : NumberFormatException should be thrown like 1.4.X does as follows. Exception in thread "main" java.lang.NumberFormatException: Illegal digit at java.math.BigInteger.<init>(BigInteger.java:316) at java.math.BigInteger.<init>(BigInteger.java:447) at java.math.BigDecimal.<init>(BigDecimal.java:216) at BigDecimalTest.main(BigDecimalTest.java:4) Actual : 1.2.2_014 : -6 1.3.1_07 : -4294967290 =============================================================================
|