From a0cf51dde7d399fbf7774df4709c19b8a7e95b4a Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 11 Jun 2008 18:24:26 +0000 Subject: [PATCH] 197719: test and fix: advising protected method calls from inner classes --- tests/bugs161/pr197719/A.java | 5 +++++ tests/bugs161/pr197719/B.java | 19 +++++++++++++++++++ tests/bugs161/pr197719/X.java | 3 +++ .../systemtest/ajc161/Ajc161Tests.java | 1 + .../org/aspectj/systemtest/ajc161/ajc161.xml | 11 +++++++++++ 5 files changed, 39 insertions(+) create mode 100644 tests/bugs161/pr197719/A.java create mode 100644 tests/bugs161/pr197719/B.java create mode 100644 tests/bugs161/pr197719/X.java diff --git a/tests/bugs161/pr197719/A.java b/tests/bugs161/pr197719/A.java new file mode 100644 index 000000000..bfb5dd9d1 --- /dev/null +++ b/tests/bugs161/pr197719/A.java @@ -0,0 +1,5 @@ +package a; + +public class A { + protected void m() { System.out.println("m() running");} +} diff --git a/tests/bugs161/pr197719/B.java b/tests/bugs161/pr197719/B.java new file mode 100644 index 000000000..cb5e2ffcf --- /dev/null +++ b/tests/bugs161/pr197719/B.java @@ -0,0 +1,19 @@ +package b; + +public class B extends a.A { + protected class Inner { + public void foo() { + System.out.println("calling m()"); + m(); + } + } + + public static void main(String []argv) { + B b = new B(); + b.run(); + } + + public void run() { + new Inner().foo(); + } +} diff --git a/tests/bugs161/pr197719/X.java b/tests/bugs161/pr197719/X.java new file mode 100644 index 000000000..2dce7a180 --- /dev/null +++ b/tests/bugs161/pr197719/X.java @@ -0,0 +1,3 @@ +public aspect X { + void around(): call(* m()) { System.out.println("advice running"); proceed();} +} diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java index fb2b75f77..ed8cd9f32 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java @@ -23,6 +23,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.1 + public void testProtectedMethodsAroundAdvice_pr197719() { runTest("protected methods and around advice - again");} public void testProtectedMethodsAroundAdvice_pr230075() { runTest("protected methods and around advice");} public void testFinalStringsAnnotationPointcut_pr174385() { runTest("static strings in annotation pointcuts");} public void testComplexBoundsGenericAspect_pr199130_1() { runTest("complex bounds on generic aspect - 1");} diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml index c15f0a4f4..0265aa7d7 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml +++ b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml @@ -3,6 +3,17 @@ + + + + + + + + + + + -- 2.39.5