Community
Participate
Working Groups
So we finally figured what changed between 3.0M3 and 3.0M4: the Java Compiler options changed to having 1.4 compliance as the default for generated class files. (We found this out through the circuitous route of inspecting the class file attributes of an M4 compile vs a working command-line one. The optimisation to swizzle JoinPoint for JoinPointStaticPart fails when ajc is passed the -1.4 option, resulting in an IncompatibleClassChangeError at runtime. Test case about to be checked into ajcTestsFailing.... and then we'll see if we can fix it!
Fixed in tree. Once the cause was isolated, the fix was relatively easy The required change was to use the setActualReceiverType method on the MessageSend node to inform it of the new receiver type so the correct code would be generated in 1.4 mode. 3 other caches of this same type are also updated to try to insulate us from future trouble.
What do you mean by fixed? Does it mean that it will be OK if we tell the compiler to generate 1.4 class files? I just tried running some very simple code: public class Test { public Test() { this(5); System.out.println("Hello()"); } public Test(int x) { System.out.println("Hello(" + x + ")"); } public static void main(String[] args ) { new Test(); } } public aspect HelloAspect { before() : call( Test.new(..) ) { //System.out.println(thisJoinPoint.getSignature()); System.out.println( "call-before"); } before() : execution(Test.new(..)) { System.out.println( "execution-before"); } } And it gives me this: java.lang.IncompatibleClassChangeError at HelloAspect.ajc$before$HelloAspect$1a3(HelloAspect.java:16) at Test.main(Test.java) Exception in thread "main" What gives? I'm using eclipse 3.0M6, AJDT 1.1.4 and AJDT/UI 0.6.4. J2SE version is 1.4.2_02. I tried both: generating 1.4 and 1.3 (rebuild after each change), both didn't work. Only by setting the source compability to 1.3, and checking the default class compat below that, did it work.
Fixed in tree means that this bug has been fixed in the latest version of the compiler in cvs. This fix will be incorporated in the 1.2 build. If you want access to this fix you need to either wait for the official 1.2 builds or build the compiler yourself from the sources. As you've noticed, the workaround until then is to use the 1.3 source and class compatibility rules that were the default before 3.0M3.