You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Irina Arkhipets (JIRA)" <ji...@apache.org> on 2006/10/10 08:11:20 UTC
[jira] Updated: (HARMONY-1796) [drlvm][jit] The second use of a
class that failed to be initialized does not throw NoClassDefFoundError in
opt mode
[ http://issues.apache.org/jira/browse/HARMONY-1796?page=all ]
Irina Arkhipets updated HARMONY-1796:
-------------------------------------
Attachment: test.java
Test source from the bug description
> [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
> Attachments: test.java
>
>
> 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