Community
Participate
Working Groups
Build ID: I20080617-2000 Steps To Reproduce: Compile and run this simple class: public class Test { static int problem(long x) { return (int) (long) x; } public static void main(String[] av) { System.out.println(Test.problem(42L)); } } This results in java.lang.VerifyError: (class: Test, method: problem signature: (J)I) Expecting to find long on stack More information: I suspect the generated class is invalid. Decompiling it with jad gives a double int cast. The problem doesn't exist with eclipse 3.3. The problem disappears when removing the unnecessary long cast. Important note: I could not reproduce this on a coworker's PC with the same version of eclipse, the same OS (windows xp) and a very similar hardware. I reproduce it on my machine 100% of the time.
This is a dup of bug 239305. See workaround there. Fix is available, and released for inclusion in 3.4.1 service release. Check the eclipse download page for access to early 3.4.1 builds. *** This bug has been marked as a duplicate of bug 239305 ***
Verified for 3.5M1 using I20080805-1307
I cannot reproduce either using I20080617-2000. I tried with a 1.4.2 VM, a 1.5.0 VM and a 1.6 VM, but they were all able to run the compiled class without verify error. So I cannot verify the bug.
Actually I was able to reproduce: you have to enable the "Unecessary cast or 'instanceof' expression" warning to see the verify error. Verified for 3.4.1 using M20080827-2000