Bug 131505 - Generated aop.xml files contain aspects for all the projects ever built
Summary: Generated aop.xml files contain aspects for all the projects ever built
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.1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-13 05:37 EST by Sian January CLA
Modified: 2012-04-03 16:16 EDT (History)
0 users

See Also:


Attachments
patch containing testcase (6.75 KB, patch)
2006-03-15 06:51 EST, Helen Beeken CLA
aclement: iplog+
Details | Diff
patch containing fix (2.94 KB, patch)
2006-03-15 06:53 EST, Helen Beeken CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sian January CLA 2006-03-13 05:37:45 EST
Using the -outxml option in AJDT the generated aop.xml files are not correct after the first build and contain all the aspects that have ever been built (including those in different projects and duplicates if an aspect has been built twice).  It seems that there is a global list of aspects (aspectNames in AjBuildManager) that is never cleared.
Comment 1 Sian January CLA 2006-03-13 05:43:03 EST
I have also just noticed that the generated names are wrong for inner classes.  I think "spacewar.Display2$SpaceObjectPainting" should be "spacewar.Display2.SpaceObjectPainting".
Comment 2 Andrew Clement CLA 2006-03-13 06:11:42 EST
The aspectNames list should either be moved into AjState or removed entirely.  If moved into AjState we will need it to be aware of file deletions as that may affect the set of aspects - hmmm, but now I come to type that, it might be that aspect deletions force a full build anyway, which creates a new state and would empty the set of aspects.

The alternative would be to remove the list entirely and just work it out at the point we create the xml file.
Comment 3 Helen Beeken CLA 2006-03-15 06:51:18 EST
Created attachment 36324 [details]
patch containing testcase

Apply this patch to the tests project.
Comment 4 Helen Beeken CLA 2006-03-15 06:53:07 EST
Created attachment 36325 [details]
patch containing fix

Apply this patch to the org.aspectj.ajdt.core project.

This patch contains a proposed fix. Namely, to move the list of aspectNames to the AjState. Note that when any changes are made to an aspect (including the deletion of one) we go back to source and do a full build. This creates a new AjState and consequently a new aspectNames list.
Comment 5 Andrew Clement CLA 2006-03-15 07:33:03 EST
patches committed.
Comment 6 Andrew Clement CLA 2006-03-27 16:42:21 EST
fix available.