From b166a7e6163889eb951f82655f0f49bfc26a49f0 Mon Sep 17 00:00:00 2001 From: acolyer Date: Tue, 16 May 2006 15:43:08 +0000 Subject: tests and fix for pr130722, 138219 --- tests/bugs152/pr130722/test/PointcutConsumer.aj | 15 ++++++++++++++ tests/bugs152/pr130722/test/Test.java | 11 +++++++++++ tests/bugs152/pr130722/test1/PointcutProvider.aj | 9 +++++++++ tests/bugs152/pr138219/PerThisWithReference.aj | 25 +++++++++++++++++++++++- tests/bugs152/pr138219/RegularPCWithReference.aj | 8 ++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 tests/bugs152/pr130722/test/PointcutConsumer.aj create mode 100644 tests/bugs152/pr130722/test/Test.java create mode 100644 tests/bugs152/pr130722/test1/PointcutProvider.aj create mode 100644 tests/bugs152/pr138219/RegularPCWithReference.aj (limited to 'tests/bugs152') diff --git a/tests/bugs152/pr130722/test/PointcutConsumer.aj b/tests/bugs152/pr130722/test/PointcutConsumer.aj new file mode 100644 index 000000000..609cb91b4 --- /dev/null +++ b/tests/bugs152/pr130722/test/PointcutConsumer.aj @@ -0,0 +1,15 @@ +package test; + +import test1.PointcutProvider; + +public aspect PointcutConsumer percflow(flow()) { + + // compiler issues the following line with + // can not find pointcut test on test.PointcutConsumer + pointcut mytest(): PointcutProvider.test(); + + // this also does not work with the same error message + pointcut mytest2(): test1.PointcutProvider.test(); + + pointcut flow(): mytest() || mytest2(); +} \ No newline at end of file diff --git a/tests/bugs152/pr130722/test/Test.java b/tests/bugs152/pr130722/test/Test.java new file mode 100644 index 000000000..35f80ec40 --- /dev/null +++ b/tests/bugs152/pr130722/test/Test.java @@ -0,0 +1,11 @@ +package test; + + +public class Test { + + public void foo() { + + } +} + + diff --git a/tests/bugs152/pr130722/test1/PointcutProvider.aj b/tests/bugs152/pr130722/test1/PointcutProvider.aj new file mode 100644 index 000000000..7bae7adce --- /dev/null +++ b/tests/bugs152/pr130722/test1/PointcutProvider.aj @@ -0,0 +1,9 @@ +package test1; + +import test.Test; +public aspect PointcutProvider { + + public pointcut test(): execution(* Test.*(..)); +} + + diff --git a/tests/bugs152/pr138219/PerThisWithReference.aj b/tests/bugs152/pr138219/PerThisWithReference.aj index c53466dfe..e7c448fa0 100644 --- a/tests/bugs152/pr138219/PerThisWithReference.aj +++ b/tests/bugs152/pr138219/PerThisWithReference.aj @@ -1,7 +1,30 @@ public aspect PerThisWithReference perthis(mypc()) { + private static int id = 0; + + public PerThisWithReference() { + id++; + } + + public String toString() { + return "PerThisWithReference:" + id; + } - pointcut mypc() : SomeOtherType.pc(); + public static void main(String[] args) { + new C().foo(); + new C().foo(); + } + pointcut mypc() : SomeOtherType.pc() && within(C); + + before() : mypc() { + System.out.println("before " + this); + } + +} + +class C { + + public void foo() {} } \ No newline at end of file diff --git a/tests/bugs152/pr138219/RegularPCWithReference.aj b/tests/bugs152/pr138219/RegularPCWithReference.aj new file mode 100644 index 000000000..ca7ab0939 --- /dev/null +++ b/tests/bugs152/pr138219/RegularPCWithReference.aj @@ -0,0 +1,8 @@ +public aspect RegularPCWithReference { + + pointcut refersToMypc() : mypc(); + + pointcut mypc() : SomeOtherType.pc(); + + +} \ No newline at end of file -- cgit v1.2.3