Bug 34210 - thisJoinPoint.getArgs() causes IncompatibleClassChangeError
Summary: thisJoinPoint.getArgs() causes IncompatibleClassChangeError
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-08 18:59 EST by Rafael Chaves CLA
Modified: 2003-03-11 14:53 EST (History)
0 users

See Also:


Attachments
Java class (199 bytes, text/plain)
2003-03-08 19:00 EST, Rafael Chaves CLA
no flags Details
First aspect (473 bytes, text/plain)
2003-03-08 19:00 EST, Rafael Chaves CLA
no flags Details
Second aspect (323 bytes, text/plain)
2003-03-08 19:01 EST, Rafael Chaves CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Chaves CLA 2003-03-08 18:59:17 EST
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.
Comment 1 Rafael Chaves CLA 2003-03-08 19:00:22 EST
Created attachment 3928 [details]
Java class
Comment 2 Rafael Chaves CLA 2003-03-08 19:00:53 EST
Created attachment 3929 [details]
First aspect
Comment 3 Rafael Chaves CLA 2003-03-08 19:01:34 EST
Created attachment 3930 [details]
Second aspect
Comment 4 Rafael Chaves CLA 2003-03-08 19:03:43 EST
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.
Comment 5 Jim Hugunin CLA 2003-03-11 14:26:53 EST
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.
Comment 6 Rafael Chaves CLA 2003-03-11 14:53:56 EST
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.