Bug 120739

Summary: LTW Optimization: Disable World if it has No Aspects
Product: [Tools] AspectJ Reporter: Ron Bodkin <rbodkin+LISTS>
Component: CompilerAssignee: Matthew Webster <matthew_webster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: DEVELOPMENT   
Target Milestone: 1.5.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Disable weaving if no aspects are defined. aclement: iplog+

Description Ron Bodkin CLA 2005-12-13 16:10:55 EST
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.
Comment 1 Ron Bodkin CLA 2005-12-13 16:11:42 EST
Created attachment 31686 [details]
Disable weaving if no aspects are defined.
Comment 2 Andrew Clement CLA 2006-02-15 06:10:48 EST
check status for 1.5.1
Comment 3 Andrew Clement CLA 2006-04-04 14:20:56 EDT
why haven't we put this in?
Comment 4 Matthew Webster CLA 2006-06-01 09:49:36 EDT
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.
Comment 5 Matthew Webster CLA 2006-06-01 12:20:30 EDT
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.
Comment 6 Matthew Webster CLA 2006-06-02 03:51:47 EDT
Fix available
Comment 7 Ron Bodkin CLA 2006-06-02 11:08:08 EDT
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)