diff options
author | aclement <aclement> | 2008-08-19 23:14:32 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-08-19 23:14:32 +0000 |
commit | 46373c59c0d02695e006d72537508ee0b52681c2 (patch) | |
tree | 4a8682fbbec4769c908091b1aff052a621878bb8 /tests/bugs162 | |
parent | 7b3134928cc1510172cbcb4693eb49e2f5d113a8 (diff) | |
download | aspectj-46373c59c0d02695e006d72537508ee0b52681c2.tar.gz aspectj-46373c59c0d02695e006d72537508ee0b52681c2.zip |
240693: test and fix: generic type defined inside around advice (mad)
Diffstat (limited to 'tests/bugs162')
-rw-r--r-- | tests/bugs162/pr240693/GenericClassInAdvice.java | 30 | ||||
-rw-r--r-- | tests/bugs162/pr240693/PayloadClass.java | 16 | ||||
-rw-r--r-- | tests/bugs162/pr240693/SomeInterface.java | 1 |
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/bugs162/pr240693/GenericClassInAdvice.java b/tests/bugs162/pr240693/GenericClassInAdvice.java new file mode 100644 index 000000000..675baefd0 --- /dev/null +++ b/tests/bugs162/pr240693/GenericClassInAdvice.java @@ -0,0 +1,30 @@ +// priviligedness of aspect contributes to the error +//public aspect GenericClassInAdvice { // comment out this line and comment the +// following to be able to compile... +privileged aspect GenericClassInAdvice { + + Object around(final SomeInterface src, final SomeInterface dst) : call(!void *.*(..)) && this(src) && target(dst) { + + // the parameterized constructor contributes to the error +// final PayloadClass<Object> payloadClass = new PayloadClass/*<Object>*/() { +// comment out this line and comment the following to be able to compile... + final PayloadClass<Object> payloadClass = new PayloadClass<Object>() { + + public void run() { + // this triggers a compiler error in combination with: + // * privilegedness of the aspect "privileged aspect ..." + // * parameterized constructor "new PayloadClass<Object>() {...}' + // * the existence of a payload field in PayloadClass + Object payload = proceed(src,dst); // comment this line and the following or rename 'payload' to 'pl' to be able to compile... + this.setPayload(payload); + } + + }; + + payloadClass.run(); + + return payloadClass.getPayload(); + } +} + + diff --git a/tests/bugs162/pr240693/PayloadClass.java b/tests/bugs162/pr240693/PayloadClass.java new file mode 100644 index 000000000..f25e2e3ae --- /dev/null +++ b/tests/bugs162/pr240693/PayloadClass.java @@ -0,0 +1,16 @@ +public class PayloadClass<Type extends Object> { + private Type payload; + + public void setPayload(Type payload) { + this.payload = payload; + } + + public Type getPayload() { + return this.payload; + } + + public void run() { + System.out.println("payload class run"); + } +} + diff --git a/tests/bugs162/pr240693/SomeInterface.java b/tests/bugs162/pr240693/SomeInterface.java new file mode 100644 index 000000000..c6750f6a3 --- /dev/null +++ b/tests/bugs162/pr240693/SomeInterface.java @@ -0,0 +1 @@ +public interface SomeInterface {} |