Community
Participate
Working Groups
AspectJ Compiler 1.1beta4 Sun JDK 1.4.1_02 Linux/1.4.1_01 Windows It seems that if two after advices affect the same join point, if the second one calls thisJoinPoint.getArgs() and the first one doesn't, a IncompatibleClassChangeError will occur when the second advice executes. Scenario 1: two after advices in the same aspect Submit Log1.aj and TestDriver.java to ajc. Run TestDriver - IncompatibleClassChangeError Scenario 2: two after advices in two different aspects Delete 2nd advice on Log1.aj, and submit Log1.aj, Log2.aj and TestDriver.java to ajc. Run TestDriver - IncompatibleClassChangeError Will attach source files.
Created attachment 3928 [details] Java class
Created attachment 3929 [details] First aspect
Created attachment 3930 [details] Second aspect
Also, it is important to specify -1.4 to ajc or instead of the Error being thrown a VM crash may occur on scenario 1.
This is fixed in the current tree. It was difficult to reproduce this error because Log1.aj didn't manifest the error as written. I had to comment out the call of thisJoinPoint.getArgs() from the second piece of after advice in order to see the error. This bug would have been easier to verify if you had just submitted a minimal test case that reproduced it.
Believe you or not, I put a few hours cutting lines from my original aspects until I could understand what was generating the error and report a bug with a minimal test case. Also, I thought I had made explicit that for testing scenario 1 you should submit only the first aspect, and for testing scenario 2 you should delete the second advice in the first aspect and submit also the second aspect. But one thing I forgot to mention is that for scenario 2 you have to ensure Log1 is processed before Log2 by passing then explicitly in the command line. By the way, thanks for fixing it. It is a showstopper for my application.