Community
Participate
Working Groups
type cast from int -> byte -> int gives incorrect warning about unnecessary cast. As you can see in the example, the cast is required, else you get a different result. eclipse 3.2m3, jdk 1.5.0_05 thanks, Cameron /** * * @author Cameron Gregory, http://www.bloke.com/ */ public class TestByte { /** * @param args */ public static void main(String[] args) { int i = 256; int j = (byte)i; // here. System.out.println(j); } }
Indeed.
*** Bug 121635 has been marked as a duplicate of this bug. ***
Fixed in 3.2 stream (HEAD). Pb did not exist in 3.1.x stream (unused cast in assign expressions were not diagnosed there). Added CastTest#test040. Note: it is not part of the warmup build.
Verified for 3.2 M5 using build I20060215-0010