From 2233cf023bce0168435795ab5747dae59fbd9a0d Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Thu, 3 Sep 2015 14:19:10 -0700 Subject: 307147: missing joinpoints for itds invoking private methods --- tests/bugs187/307147/ITDAspect.aj | 11 ++++++++ tests/bugs187/307147/Test.java | 28 ++++++++++++++++++++ tests/bugs187/307147/TestAspect.aj | 8 ++++++ tests/bugs187/307147_2/ITDAspect.aj | 10 ++++++++ tests/bugs187/307147_2/Test.java | 16 ++++++++++++ tests/bugs187/307147_2/TestAspect.aj | 9 +++++++ .../org/aspectj/systemtest/ajc187/Ajc187Tests.java | 8 ++++++ tests/src/org/aspectj/systemtest/ajc187/ajc187.xml | 30 ++++++++++++++++++++++ 8 files changed, 120 insertions(+) create mode 100644 tests/bugs187/307147/ITDAspect.aj create mode 100644 tests/bugs187/307147/Test.java create mode 100644 tests/bugs187/307147/TestAspect.aj create mode 100644 tests/bugs187/307147_2/ITDAspect.aj create mode 100644 tests/bugs187/307147_2/Test.java create mode 100644 tests/bugs187/307147_2/TestAspect.aj (limited to 'tests') diff --git a/tests/bugs187/307147/ITDAspect.aj b/tests/bugs187/307147/ITDAspect.aj new file mode 100644 index 000000000..5442a5825 --- /dev/null +++ b/tests/bugs187/307147/ITDAspect.aj @@ -0,0 +1,11 @@ +package test; + +import test.Test; + +public privileged aspect ITDAspect { + public void Test.itdFunction() { + System.out.println("ITD function"); + privateMethod(); + publicMethod(); + } +} diff --git a/tests/bugs187/307147/Test.java b/tests/bugs187/307147/Test.java new file mode 100644 index 000000000..25b4eef4d --- /dev/null +++ b/tests/bugs187/307147/Test.java @@ -0,0 +1,28 @@ +package test; + +public class Test { + + public Test() { + } + + public static void main(String[] args) { + Test t = new Test(); + t.function(); + t.itdFunction(); + } + + public void function() { + System.out.println("Normal function"); + privateMethod(); + publicMethod(); + } + + private void privateMethod() { + System.out.println("private method"); + } + + public void publicMethod() { + System.out.println("public method"); + } + +} diff --git a/tests/bugs187/307147/TestAspect.aj b/tests/bugs187/307147/TestAspect.aj new file mode 100644 index 000000000..cf53868e3 --- /dev/null +++ b/tests/bugs187/307147/TestAspect.aj @@ -0,0 +1,8 @@ +package test; + +public aspect TestAspect { + Object around(): call(* Test.*(..)) { + System.out.println("Around " + thisJoinPoint.toString()); + return proceed(); + } +} diff --git a/tests/bugs187/307147_2/ITDAspect.aj b/tests/bugs187/307147_2/ITDAspect.aj new file mode 100644 index 000000000..c3e22ee7d --- /dev/null +++ b/tests/bugs187/307147_2/ITDAspect.aj @@ -0,0 +1,10 @@ +package test; + +import test.Test; + +public privileged aspect ITDAspect { + public void Test.itdFunction() { + System.out.println("ITD function"); + privateMethod("Foo"); + } +} diff --git a/tests/bugs187/307147_2/Test.java b/tests/bugs187/307147_2/Test.java new file mode 100644 index 000000000..fe184dfe5 --- /dev/null +++ b/tests/bugs187/307147_2/Test.java @@ -0,0 +1,16 @@ +package test; + +public class Test { + + public Test() { + } + + public static void main(String[] args) { + Test t = new Test(); + t.itdFunction(); + } + + private void privateMethod(String xxx) { + System.out.println("hello "+xxx); + } +} diff --git a/tests/bugs187/307147_2/TestAspect.aj b/tests/bugs187/307147_2/TestAspect.aj new file mode 100644 index 000000000..24cef6c79 --- /dev/null +++ b/tests/bugs187/307147_2/TestAspect.aj @@ -0,0 +1,9 @@ +package test; + +public aspect TestAspect { + Object around(String s): call(* Test.*(..)) && args(s) { + System.out.println("Around " + thisJoinPoint.toString()); + System.out.println("Captured "+s); + return proceed(s.toUpperCase()); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc187/Ajc187Tests.java b/tests/src/org/aspectj/systemtest/ajc187/Ajc187Tests.java index ece3240e0..3fce314bd 100644 --- a/tests/src/org/aspectj/systemtest/ajc187/Ajc187Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc187/Ajc187Tests.java @@ -24,6 +24,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Ajc187Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testMissingJoinpoint_307147() throws Exception { + runTest("missing joinpoint"); + } + + public void testMissingJoinpoint_307147_2() throws Exception { + runTest("missing joinpoint 2"); + } + public void testInfiniteLoop_475152() throws Exception { runTest("infinite loop"); } diff --git a/tests/src/org/aspectj/systemtest/ajc187/ajc187.xml b/tests/src/org/aspectj/systemtest/ajc187/ajc187.xml index e6db6d5e5..19706f43a 100644 --- a/tests/src/org/aspectj/systemtest/ajc187/ajc187.xml +++ b/tests/src/org/aspectj/systemtest/ajc187/ajc187.xml @@ -2,6 +2,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3