Community
Participate
Working Groups
We encounter an issue in AspectJ 1.6.8 which is LTW removes all interfaces which added by CTW, and it failed to add them back. The scenario is we have a class Parent which has one interview added by CTW, and it has a Child class which is not woven class. Then, we want to use LTW to weave the Child Class. However, when we use the same Aspect in aop.xml to weave them we found that LTW could fail to weave the Parent class if the classloader load Child class first. Then, I changed the class sequence to load Parent class first, and this time LTW correct weaves both Parent class and Child class to add Interfaces back. It looks like this issue only in 1.6.8 because I did not get this issue in both 1.6.5 and 1.6.10. Is this a known issue? (I did not see this in releasenotes of 1.6.9 and 1.6.10.) If it is a known issue, can I know the reason. Thanks. David
Although AspectJ may occasionally weave things in a different order during loadtime as opposed to compile time (because of classloader loading order), the resultant woven code as a whole should still be consistent as described by the aspects affecting the system. If the code is 'broken' when, in your case, the Child is woven but the parent is not - that is a bug. If the code is correct, but it just Nothing is mentioned in the release notes related to this as nothing has knowingly been changed to cause this, however various optimizations have been going in lately to less pro-actively hunt for types (causing less parents or superinterfaces to be pulled in if they aren't required). 1.6.7/1.6.8 were a massive refactoring for the AspectJ internals and numerous bugs that it accidentally introduced have been ironed out in 1.6.9 and 1.6.10, it is possible one of those fixes addressed your situation and got things back on track. If you are happy and working, I'd say it was just a temporary problem introduced by that refactoring effort. Browsing bugs fixed in 1.6.9 and 1.6.10 may reveal which fix addressed it. The default weaver mode for dealing with the loadtime weaving of compile time weaving mode is 'reweaving'. An alternative you might want to try using is 'overweaving' http://andrewclement.blogspot.com/2010/05/aspectj-overweaving.html - with overweaving your Parent class remains woven from CTW, rather than reverting to the original form. I only mention this FYI, if you're working fine on 1.6.10 you dont necessarily need overweaving.
Thanks for your detailed explanation. It makes sense to me. David
dont think there is anything further to address here.