From 94d8b82fbf3cb18a14d77508b3adad6d50434080 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 6 Apr 2006 10:44:14 +0000 Subject: [PATCH] test and fix for 134541 --- tests/multiIncremental/PR134541/base/A.aj | 8 ++++++++ tests/multiIncremental/PR134541/inc1/A.aj | 10 ++++++++++ .../tools/MultiProjectIncrementalTests.java | 14 ++++++++++++++ .../org/aspectj/weaver/CrosscuttingMembers.java | 6 +++++- .../org/aspectj/weaver/CrosscuttingMembersSet.java | 5 +++++ 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/multiIncremental/PR134541/base/A.aj create mode 100644 tests/multiIncremental/PR134541/inc1/A.aj diff --git a/tests/multiIncremental/PR134541/base/A.aj b/tests/multiIncremental/PR134541/base/A.aj new file mode 100644 index 000000000..73b2136e9 --- /dev/null +++ b/tests/multiIncremental/PR134541/base/A.aj @@ -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 index 000000000..0138161f0 --- /dev/null +++ b/tests/multiIncremental/PR134541/inc1/A.aj @@ -0,0 +1,10 @@ +public aspect A { + + pointcut p() : execution(* *.*(..)); + + + + before() : p() { + } + +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index e4e88e377..c6f6672a5 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -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 diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java index fcbd967cf..46b6ada85 100644 --- a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java +++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java @@ -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 diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java index b4efd2c87..a065aa14f 100644 --- a/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java +++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java @@ -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; } } -- 2.39.5