harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Irina Arkhipets (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1796) [drlvm][jit] The second use of a class that failed to be initialized does not throw NoClassDefFoundError in opt mode
Date Tue, 10 Oct 2006 06:08:19 GMT
[drlvm][jit] The second use of a class that failed to be initialized does not throw NoClassDefFoundError
in opt mode
--------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1796
                 URL: http://issues.apache.org/jira/browse/HARMONY-1796
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Windows XP (IA-32), Suse linux  9 (IA-32)
            Reporter: Irina Arkhipets


The second use of a class that failed to be initialized does not throw NoClassDefFoundError
as expected in opt mode.

This bug is not reproducible with interpreter, as well as in jet and default modes.

I am able to reproduce this bug both on Windows IA-32 and Linux IA-32 platforms.

Please, compile and run the following test example to reproduce the failure:

--------- test.java ---------
public class test {
	public static void main(String [] args) {
		try {
			System.out.println(MyClass.val);
		} catch (ExceptionInInitializerError e) {}
		
		try {
			new MyClass();
		} catch (NoClassDefFoundError e) {
			System.out.println("The test PASSED!");
			System.exit(-1);
		}

		System.out.println("The test FAILED!");
	}
}

class MyClass {
	static int val;

	static {
		val = 0 / 0;
	}

	public MyClass() {}
}
-------------------------------

It is expected that the test throws ExceptionInInitializerError exception (because of division
by zero in MyClass class static initializer) and then any attempt to call MyClass methods
will cause NoClassDefFoundError.

However, clear opt does not behave in this way and the test fails.

Sample output is:
...
$> $JAVA_PATH test
The test PASSED!

$> $JAVA_PATH -Xem:opt test
The test FAILED!

...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message