[
http://jira.codehaus.org/browse/JANINO-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John V Sichi updated JANINO-31:
-------------------------------
Attachment: ExecutableStmt.java
> IncompatibleClassChangeError when loading nested classes
> --------------------------------------------------------
>
> Key: JANINO-31
> URL:
http://jira.codehaus.org/browse/JANINO-31> Project: Janino
> Issue Type: Bug
> Environment: BEA jrockit81sp3_142_04
> Janino 2.3.7
> Reporter: kdx
> Assignee: Arno Unkrig
> Priority: Critical
> Attachments: atd.patch, ExecutableStmt.java, janinoc-incompatibleclasschangeerror-testcase.zip
>
>
> Such a class:
> public class Function_0 {
> public static class PrintX {
> public static void printX() {
> System.err.println("x");
> }
> }
> }
> when compiled by Janino and the resulting class files loaded via the ByteArrayClassLoader like this:
> ByteArrayClassLoader bacl = new ByteArrayClassLoader(classes, parent);
> Class clazz = bacl.loadClass(classNames[0]);
> System.err.println(clazz.getDeclaredClasses());
> results in a verification error on BEA's jrockit81sp3_142_04 JVM:
> java.lang.IncompatibleClassChangeError: Function_0$PrintX
> at java.lang.Class.getDeclaredClasses0(I)[Ljava.lang.Class;(Unknown Source)
> at java.lang.Class.getDeclaredClasses(I)[Ljava.lang.Class;(Unknown Source)
> at Main.main([Ljava.lang.String;)V(Main.java:45)
> And seems to work fine on Sun's j2sdk1.4.2_04:
> [Ljava.lang.Class;@206c555
> BEA's website claims that JRockit performs stricter type checks than Sun's JVM, see "Why is JRockit throwing a ClassFormatError, IncompatibleClassChangeError or other LinkageError exceptions when the Sun JVM is not?" at
http://e-docs.bea.com/wljrockit/docs81/dev_faq.html> The attached source, when compiled by Sun's j2sdk1.4.2_04, runs fine both on the Sun j2sdk1.4.2_04 and BEA jrockit81sp3_142_04 JVMs. When compiled by Janino 2.3.7, it runs fine on the Sun j2sdk1.4.2_04 JVM, but not, as said above, on BEA jrockit81sp3_142_04.
> To verify that it is only the nested classes that cause the problem, the Main.class may be overwritten with a Sun-compiled version (while keeping the Function_0*.class files Janino-compiled) and the IncompatibleClassChangeError still happens.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email