Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.6.2, 1.6.3
-
Fix Version/s: 1.6.4, 1.7-beta-1
-
Component/s: groovy-jdk
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
code below can be executed with No problem in the release 1.5.8 but in 1.6.2,1.6.3 we have exception
saying:
java.lang.NumberFormatException:For input string "V"
code tested:
def a = "V"
def b = a as int
println b
in 1.5.8 out put is
86
I reduced the priority, because I think this is no critical bug. Next thing is, that I am not sure this is even a bug. Didn't we change the implementation to let asType(int) read a string number, parse the number and then give back that number? This conflicts with single char strings like "1", where the old code returned the ordinal and the new code will return 1. IMHO if we want to keep that change, then the current behavior is correct and should not be changed. The user should have used b=(int)a, which behaves still as in 1.5.8.