Bug 120739 - LTW Optimization: Disable World if it has No Aspects
Summary: LTW Optimization: Disable World if it has No Aspects
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.2   Edit
Assignee: Matthew Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-13 16:10 EST by Ron Bodkin CLA
Modified: 2012-04-03 14:17 EDT (History)
0 users

See Also:


Attachments
Disable weaving if no aspects are defined. (2.04 KB, patch)
2005-12-13 16:11 EST, Ron Bodkin CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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)