Community
Participate
Working Groups
This optimization disables weaving for a ClassLoader where there are no aspects defined. This is actually useful if you have aspect exclusions that exclude all the aspects defined in a parent class loader. It is also helpful in the trivial/rare case where there is an aop.xml definition with no aspect definitions.
Created attachment 31686 [details] Disable weaving if no aspects are defined.
check status for 1.5.1
why haven't we put this in?
This is a good optimization. I have added a message, similar to that issued when no aop.xml is found, and a 1.5.2 testcase. In the long run it might be better to more aggressively parse the XML into a Configuration object (paving the way for a programmatic API) so that we don’t create then throw away the Weaver and World.
4 tests failed: testLTWDump/BeforeAndAfter/Proxy and testCompileTimeAspectsDeclaredToLTWWeaver because they don't have an aspect and hence no weaving took place or the new message caused problems. I amended the expected messages and added EmptyAspect.aj/EmptyAtAspect.java to the compile step and relevant aop.xml files.
Fix available
I agree that parsing into an options file would be better. This would also be a step towards reusing the parsing when aop.xml files are shared by multiple ClassLoaders (based on the same URL). That in turn would allow sharing initial weaver state (using a test to make sure that there isn't a different class definition between the different ClassLoaders, e.g., by nondelegation)