aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-21 10:39:34 +0000
committeraclement <aclement>2005-11-21 10:39:34 +0000
commit6bda5d41e9a0c8a31a6675e8374cf45f25331edd (patch)
treeaa3ec4cf9abe790292d2f1dd74b44a948b72603f
parent490749300499a9dac9d290d32cb56ef37e13d74e (diff)
downloadaspectj-6bda5d41e9a0c8a31a6675e8374cf45f25331edd.tar.gz
aspectj-6bda5d41e9a0c8a31a6675e8374cf45f25331edd.zip
two test programs for 115250
-rw-r--r--tests/bugs150/pr115250.aj36
-rw-r--r--tests/bugs150/pr115250_2.aj38
2 files changed, 74 insertions, 0 deletions
diff --git a/tests/bugs150/pr115250.aj b/tests/bugs150/pr115250.aj
new file mode 100644
index 000000000..ccda14adc
--- /dev/null
+++ b/tests/bugs150/pr115250.aj
@@ -0,0 +1,36 @@
+public class pr115250 {
+ public static void main(String[] args) {
+ test();
+ }
+ public static void test() {
+ new C();
+ }
+
+ static class C {
+ C() {
+ System.err.println("C.new() running");
+ }
+ }
+
+ // properly get compiler error wrt return type of join point
+ static aspect Normal {
+ C around() : execution(C.new()) {
+ return proceed();
+ }
+ }
+
+
+ // no compiler error wrt return type of join point
+
+ static abstract aspect SS<Target> {
+ abstract protected pointcut creation();
+ Target around() : creation() { // expect CE for execution(C.new());
+ System.err.println("Advice running");
+ return proceed();
+ }
+ }
+
+ static aspect A extends SS<C> {
+ protected pointcut creation() : execution(C.new());
+ }
+}
diff --git a/tests/bugs150/pr115250_2.aj b/tests/bugs150/pr115250_2.aj
new file mode 100644
index 000000000..37cfd0eef
--- /dev/null
+++ b/tests/bugs150/pr115250_2.aj
@@ -0,0 +1,38 @@
+public class pr115250_2 {
+ public static void main(String[] args) {
+ test();
+ }
+ public static void test() {
+ new C().foo();
+ }
+
+ static class C {
+ C() {
+ System.err.println("C.new() running");
+ }
+
+ C foo() { return null; }
+ }
+
+ // properly get compiler error wrt return type of join point
+ static aspect Normal {
+ C around() : execution(* C.foo()) {
+ return proceed();
+ }
+ }
+
+
+ // no compiler error wrt return type of join point
+
+ static abstract aspect SS<Target> {
+ abstract protected pointcut creation();
+ Target around() : creation() { // expect CE for execution(C.new());
+ System.err.println("funky advice running");
+ return proceed();
+ }
+ }
+
+ static aspect A extends SS<C> {
+ protected pointcut creation() : execution(* C.foo());
+ }
+}