Community
Participate
Working Groups
I have some static initialisers that I am forcing to execute from another class using an unused local variable thus: Class c = Layout.class; // c is never used When compiled with Eclipse 2.1 (actually one of the maintenance builds) this has the desired effect of forcing the static initializers in my Layout class to be executed, but in Eclipse 3.0-M1 it does not (even though the Java, Compiler, Compliance and Classfiles, Preserve unused local variables preference is set).
This has nothing to do with preservation of unused local variable. This is a consequence of fix for bug 37565. FYI, class literal is spec'ed to not perform class init, and we had a bug (as other compilers). See related bug for link to spec.