]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 134541
authoraclement <aclement>
Thu, 6 Apr 2006 10:44:14 +0000 (10:44 +0000)
committeraclement <aclement>
Thu, 6 Apr 2006 10:44:14 +0000 (10:44 +0000)
tests/multiIncremental/PR134541/base/A.aj [new file with mode: 0644]
tests/multiIncremental/PR134541/inc1/A.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java

diff --git a/tests/multiIncremental/PR134541/base/A.aj b/tests/multiIncremental/PR134541/base/A.aj
new file mode 100644 (file)
index 0000000..73b2136
--- /dev/null
@@ -0,0 +1,8 @@
+public aspect A {
+       
+       pointcut p() : execution(* *.*(..));
+       
+       before() : p() {
+       }
+       
+}
diff --git a/tests/multiIncremental/PR134541/inc1/A.aj b/tests/multiIncremental/PR134541/inc1/A.aj
new file mode 100644 (file)
index 0000000..0138161
--- /dev/null
@@ -0,0 +1,10 @@
+public aspect A {
+       
+       pointcut p() : execution(* *.*(..));
+       
+       
+       
+       before() : p() {
+       }
+       
+}
index e4e88e3770ea857f4bb053543602ed316f0119c0..c6f6672a58a429b2b511547e7a9eca1efd4d23e8 100644 (file)
@@ -846,6 +846,20 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
                                  decisions.indexOf(expect)!=-1);
        }
        
+       public void testPr134541() {
+               initialiseProject("PR134541");
+               build("PR134541");
+               assertEquals("[Xlint:adviceDidNotMatch] should be associated with line 5",5,
+                               ((IMessage)MyTaskListManager.getWarningMessages().get(0)).getSourceLocation().getLine());
+               alter("PR134541","inc1");
+               build("PR134541");
+               checkWasntFullBuild(); // we've only added a white space therefore we 
+                                      // shouldn't be doing a full build
+               assertEquals("[Xlint:adviceDidNotMatch] should now be associated with line 7",7,
+                               ((IMessage)MyTaskListManager.getWarningMessages().get(0)).getSourceLocation().getLine());
+       }
+       
+       
        // other possible tests:
        // - memory usage (freemem calls?)
        // - relationship map
index fcbd967cf1dff815520220c9b535856d3b12d90f..46b6ada851e4abd19a9a35d223d4a0f1d70a11f3 100644 (file)
@@ -238,8 +238,12 @@ public class CrosscuttingMembers {
                        }
                        if (!theseShadowMungers.equals(otherShadowMungers)) {
                                changed = true;
-                               shadowMungers = other.shadowMungers;
                        }
+                       // replace the existing list of shadowmungers with the 
+                       // new ones in case anything like the sourcelocation has
+                       // changed, however, don't want this flagged as a change
+                       // which will force a full build - bug 134541
+                       shadowMungers = other.shadowMungers;
            }
            
                // bug 129163: use set equality rather than list equality and
index b4efd2c87108bdd2cc67390593563df35293adad..a065aa14f85493b81c52914144861a8d8e21977a 100644 (file)
@@ -76,6 +76,11 @@ public class CrosscuttingMembersSet {
                                CflowPointcut.clearCaches(aspectType);
                                change = true;
                        } else {
+                               if (careAboutShadowMungers) {
+                                       // bug 134541 - even though we haven't changed we may have updated the 
+                                       // sourcelocation for the shadowMunger which we need to pick up
+                                       shadowMungers = null;
+                               }
                                change = false;
                        }
                }