Community
Participate
Working Groups
1. download and unpack http://www.fuurou.org/downloads/aspectjtest.zip (I couldn't find a way of attaching it) 2. copy the aspectj jars into the lib directory 3. run ant The ant file executes both source code and byte code weaving and then it veryfies that the class hierarchy was changed. As you can see from the output in case of source weaving the test is: [java] Is [class lib.C] subcass of [class weaved.SuperC]? true while when weaving bytecode: [java] Is [class lib.C] subcass of [class weaved.SuperC]? false
Created attachment 28234 [details] test case Same as http://www.fuurou.org/downloads/aspectjtest.zip, I did not see the attachment option before
fix available.
i think I put that comment in the wrong bug - let me double check.
something funny is going on. There is a bug, and I've fixed it - but I couldnt recreate it with the ANT build.xml as-is. When I run the ant script, I get the same output as you: [java] Is [class lib.C] subcass of [class weaved.SuperC]? false However, the reason it says 'false' is that this command: <java classname="weaved.SuperC"> <classpath> <path refid="aspectj.classpath"/> <pathelement path="${classes.dir}"/> <pathelement location="${dist.dir}/weaved-lib.jar"/> </classpath> </java> puts classes ahead of weaved-lib in order to find weaved.SuperC - and for some reason 'classes' still contains lib/A.class lib/B.class and lib/C.class - when they should have been deleted earlier. When the old version of lib/C.class is loaded from classes, it reports that its new parent isnt SuperC. The bug was incorrectly modifying super calls - we omitted the package name if the new parent was in a package which caused a hideous verifyerror. If you want to see the verifyerror, change the order in the task above to: <classpath> <path refid="aspectj.classpath"/> <pathelement location="${dist.dir}/weaved-lib.jar"/> <pathelement path="${classes.dir}"/> </classpath> I've put tests in the suite for this - but I'm not going to spend time debugging the ant any further. I've no idea why the javac task that is told to compile src/weaved/* also compiles src/lib/*... fix checked in.
fix is available.