Bug 8773 - VerifyError : A .class file exported from VAJ does not run in JDK 1.2.2 (1GPPET0)
Summary: VerifyError : A .class file exported from VAJ does not run in JDK 1.2.2 (1GPP...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-30 13:00 EST by Philipe Mulet CLA
Modified: 2002-02-11 04:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2002-01-30 13:00:21 EST
Build 20020125

This defect was originally reported against VAJ 3.5.3, and we have the same bug 
in Eclipse.

==================
When compiling the following test case and running it, we get a verification 
error:

  "Exception in thread "main" java.lang.VerifyError:
   (class: VerifyEr, method: err signature: ()Z)
   Register 1 contains wrong type"

STEPS TO RECREATE THE PROBLEM:

1. Have VAJava installed.  Also install JDK 1.2.2.
2. Create a test project and import VerifyEr.java to the test project.
3. Run the "test" class from the "Workbench" window.  This confirms that
   the class compiled using VAJava compiler runs normally on VAJava
   environment.
4. Export the class to a directory.
5. Run the exported class on JDK.  This produces the verify error as
   mentioned above. <----------------------------- This is the problem !
6. Compile the VerifyEr.java using JDK.
7. Run the class compiled by JDK on JDK.  Confirm "No Err".

THE SOURCE CODE FOR THE TEST CASE:

/**
 * VerifyError
  * @author: Administrator
 */
class VerifyEr {

     protected int ii;

/**
 * VerifyEr
 */
public VerifyEr() {
     super();
     System.out.println("No Err");
}
protected boolean err() {
     try {

          ii = 0;
          System.out.println("I'm here");

     } catch (Throwable t) {

          return getb();
     } finally {
          try {
               if (getb()) {
                    return getb();
               }
          } finally {
               if (getb()) {
                    return false;
               }
          }
     }
     return false;
}
protected boolean getb() {
     System.out.println("I'm here");
     return false;

}
/**
 */
public static void main(String[] args) {

     new VerifyEr();
}
}
Comment 1 Philipe Mulet CLA 2002-01-30 13:03:22 EST
Bug is due to the fact we share all saveValueVariables, and in case of nested 
finally blocks, it clearly shouldn't occur.

Simpler test case:

class VerifyEr {
protected boolean err(boolean b) {
     try {
          System.out.print("SUCC");
     } catch (Throwable t) {
          return b;
     } finally {
          try {
               if (b) {
                    return b;
               }
          } finally {
          		System.out.println("ESS");
          }
     }
     return false;
}

public static void main(String[] args) {
     new VerifyEr().err(false);
}
}

should print SUCCESS and doesn't
Comment 2 Philipe Mulet CLA 2002-01-30 13:04:03 EST
Fixed in latest, added regression test.