Bug 93310 - Incremental Compilation Problem on Reweavable
Summary: Incremental Compilation Problem on Reweavable
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M2   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-29 14:53 EDT by Ron Bodkin CLA
Modified: 2012-04-03 16:04 EDT (History)
0 users

See Also:


Attachments
testcase patch (5.53 KB, patch)
2005-11-22 11:23 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 Ron Bodkin CLA 2005-04-29 14:53:08 EDT
I just refactored (manually) by renaming an aspect that affected a couple of 
classes in my project. I then received an error about the old aspect name 
being out of date for reweavability (?) pointing at the affected classes, 
after saving under the new name (triggering the incremental compile). A full 
compile cleared the error....
Comment 1 Ron Bodkin CLA 2005-04-29 16:54:34 EDT
The following steps reproduce this problem reliably for me.

Add a static inner aspect to some type:

class MyTestCase extends TestCase {
...
  static aspect Monitor {
      before() : cflow(pc1()) && pc2() {}
  }
}

If I comment out the aspect and save, I get lots of messages like this:
2	type com.crankj.monitor.resource.TestCase$Monitor is needed by 
reweavable type <Type>
Comment 2 Andrew Clement CLA 2005-05-03 05:44:02 EDT
Hmm - I know *exactly* why this error occurs...
Comment 3 Ron Bodkin CLA 2005-11-19 17:05:22 EST
This is still a problem in the latest versions...
Comment 4 Helen Beeken CLA 2005-11-22 11:23:09 EST
Created attachment 30388 [details]
testcase patch

Patch containing a MultiProjectIncrementalTest which simulates the steps Ron describes to recreate the problem. It needs an aspect A which applies to a class C1 and then another aspect Monitor within the same file as a class C2 which also applies to C1. C2.java is then deleted and replaced with C2.aj. 

In the case where C2.aj is the same as C2.java but with the Monitor aspect commented out (MultiProjectIncrementalTest.testPr93310_1()) the following error is reported:

Build errors:
error at package pack;
^^^^^^^^^^^^^
C:\temp\ajcSandbox\ajcTest40937.tmp\PR93310_1\src\pack\C1.java:0::0 type pack.Monitor is needed by reweavable type pack.C1
---------

In the case where C2.aj is exactly the same as C2.java (MultiProjectIncrementalTest.testPr93310_2()), then the following error is reported:

Build errors:
error at (no source information available)
C:\temp\ajcSandbox\ajcTest203.tmp\PR93310_2\src\pack\C1.java:0::0 aspect 'pack.Monitor' woven into 'pack.C1' must be declared in an aop.xml file.
---------

Apply this patch to the tests project.
Comment 5 Andrew Clement CLA 2005-11-25 09:55:19 EST
test patch checked in - commented out.  hoping adrians changes about to go in might fix this ...
Comment 6 Andrew Clement CLA 2005-11-28 08:18:16 EST
fixed by my changes for another incremental bug ;)  Yey!  testcases are now passing.
Comment 7 Andrew Clement CLA 2005-11-29 05:19:20 EST
fix available.