Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Compiler innerclass emulation change

If you do care about serializing instances of local innerclasses, then you
should read this note below.

We recently ran the JACKS test suite over our compiler, and found this
interesting issue:

=============
JACKS: VerifyError when affecting final local in anonymous class header (
http://bugs.eclipse.org/bugs/show_bug.cgi?id=26122)
=============

Basically, we were generated invalid code for the following source, which
would result into a verify error at runtime:

        final int i;
        new A(i = 1) {
            { System.out.print(i); }
        };

since we were emulating this into:

        final int i;
        new A(i, i = 1) { // A(int val$i, int someInt) - synthetic argument
added before
            { System.out.print(val$i); }
        };

instead of:
        final int i;
        new A(i = 1, i) { //A (int someInt, int val$i) - synthetic argument
added after
            { System.out.print(val$i); }
        };

Therefore, we had to swap the order of arguments passed to the constructor,
so that captured outer local variables reflect possible side-effects which
occurred during argument expression evaluation.

This means all constructor signatures for local types may have changed
since we released this bug fix (from integration build 20021126 on).







Back to the top