Community
Participate
Working Groups
eclipse raise an unecessary cast in a case that require a cast : char c=... System.out.println("%d\n",(int)c); in this case, the cast is usefull because c must be box in Integer.
*** Bug 100218 has been marked as a duplicate of this bug. ***
There is no boxing there, it is either using PrintStream#println(char) or PrintStream#println(int). Now, there shouldn't be any warning signalled here.
Actually, there is some boxing, but the example is wrong, it should be using #printf(...) instead of #println(...) public class X { public static void main(String[] s) { char c = 'a'; System.out.printf("%d\n",(int)c); } }
oups, you are right, it's a typo when i report the bug. Rémi
Changed diagnosis to tolerate this boxing scenario. Added AutoboxingTest#test114-115. Released both in 3.1.x and 3.2 streams.
Verified for 3.1.2 in M20060109-0800.
Verified for 3.2M4 in I20051215-1506