Community
Participate
Working Groups
The following code throws a VerifyError when compiling in Eclipse 2.0.1 (JDK 1.3.1_04, Windows 2000): class Recipient { private short statusCode = 0; public void setStatusCode(short statusCode) { this.statusCode = statusCode; } } public class JavaBug { public final short RECIPIENT_ACTIVE = 1; public void reactivateAccount() { Recipient r = new Recipient(); r.setStatusCode((short) this.RECIPIENT_ACTIVE); } public static void main(String[] args) { JavaBug jb = new JavaBug(); jb.reactivateAccount(); } } It seems that casting primitive final fields to its own type causes this error. If you remove final before RECIPIENT_ACTIVE or change the cast line to r.setStatusCode((short) ((int) this.RECIPIENT_ACTIVE)); The error is not occured.
Szia Csaba, We fixed this defect which was affecting all identical cast applied to base type constants (see bug 22673). This issue is resolved in 2.1 integration builds. You may alternatively want to download our 2.0.2 patch preview which contains the fix (see http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-core- home/r2.0/main.html#updates). Now after having installed the patch, you will need to edit the org.eclipse.jdt.core/plugin.xml to change its version ID from "2.0.2" down to "2.0.1" in order for it to work properly with a 2.0.1 build.
*** This bug has been marked as a duplicate of 22673 ***