From fc0d2af02cc6b6f8a4d9425e3c1cdd166957dde9 Mon Sep 17 00:00:00 2001 From: jhugunin Date: Thu, 18 Sep 2003 18:38:14 +0000 Subject: [PATCH] fix and test for Bugzilla Bug 43194 java.lang.VerifyError in generated code Bug was that a portion of ReferencePointcut.concretize was not behaving functionally but was mutating state. --- tests/ajcTests.xml | 6 +++++ tests/bugs/AdviceInteraction.java | 25 +++++++++++++++++++ .../weaver/patterns/ReferencePointcut.java | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/bugs/AdviceInteraction.java diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 39dd3b146..9fd028f8f 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -6757,4 +6757,10 @@ + + + + + diff --git a/tests/bugs/AdviceInteraction.java b/tests/bugs/AdviceInteraction.java new file mode 100644 index 000000000..1d72ad593 --- /dev/null +++ b/tests/bugs/AdviceInteraction.java @@ -0,0 +1,25 @@ +public class AdviceInteraction { + public static void main(String [] args) { + new C().m1(); + } +} + +class C { + public void m1() {} + public void m2() {} +} + +aspect A { + pointcut exec1(C c): this(c) && execution(void m1()); + pointcut execs(C c): exec1(c); + + before (): execs(*) {} + before (C c): execs(c) {} + + // This ordering works correctly + pointcut exec2(C c): this(c) && execution(void m2()); + pointcut execs2(C c): exec2(c); + + before (C c): execs2(c) {} + before (): execs2(*) {} +} \ No newline at end of file diff --git a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java index 907836447..8781641c7 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java @@ -249,7 +249,7 @@ public class ReferencePointcut extends Pointcut { //System.err.println("start: " + searchStart); ResolvedTypeX[] parameterTypes = searchStart.getWorld().resolve(pointcutDec.getParameterTypes()); - arguments = arguments.resolveReferences(bindings); + TypePatternList arguments = this.arguments.resolveReferences(bindings); IntMap newBindings = new IntMap(); for (int i=0,len=arguments.size(); i < len; i++) { -- 2.39.5