Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.0-JSR-4
-
Fix Version/s: None
-
Component/s: syntax
-
Labels:None
-
Environment:JSR4
-
Number of attachments :
Description
String s = "5"
int x = s
The effect of this code is that x is assigned the value of char '5'.
String s = "10"
int x = s
This produces a runtime exception.
If auto-conversion is absolutely needed between 1-character Strings and ints, then one would hope it would at least be limited to literal Strings. This behavior makes no sense.