Community
Participate
Working Groups
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....
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>
Hmm - I know *exactly* why this error occurs...
This is still a problem in the latest versions...
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.
test patch checked in - commented out. hoping adrians changes about to go in might fix this ...
fixed by my changes for another incremental bug ;) Yey! testcases are now passing.
fix available.