diff options
author | aclement <aclement> | 2009-03-16 18:40:12 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-03-16 18:40:12 +0000 |
commit | 1c9611faa2341eb315045ce1ab0df0269a7ab423 (patch) | |
tree | 51ea2aa25f1c5fefdb5537e8ff5670388ce24714 /tests | |
parent | 30fd8c9133fc57c7b6082d460dad2e2d9dad950b (diff) | |
download | aspectj-1c9611faa2341eb315045ce1ab0df0269a7ab423.tar.gz aspectj-1c9611faa2341eb315045ce1ab0df0269a7ab423.zip |
268710: test and fix: marker interface within generic aspect
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs164/pr268710/ConcreteAspect.aj | 26 | ||||
-rw-r--r-- | tests/bugs164/pr268710/GenericAspect.aj | 16 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc164/ajc164.xml | 14 |
4 files changed, 57 insertions, 3 deletions
diff --git a/tests/bugs164/pr268710/ConcreteAspect.aj b/tests/bugs164/pr268710/ConcreteAspect.aj new file mode 100644 index 000000000..14abbfc93 --- /dev/null +++ b/tests/bugs164/pr268710/ConcreteAspect.aj @@ -0,0 +1,26 @@ +/** + * + */ +package none; + +/** + * @author Dawid Pytel + * + */ +public aspect ConcreteAspect extends GenericAspect<String> { + + public static void main(String [] argv) { + new C(); + } + + + before(SomeInterface v): SomeConstructor(v) { + System.out.println("Building an object "+v.getClass()); + } +} + +class C implements GenericAspect.SomeInterface { + public C() { + System.out.println("C.init"); + } +} diff --git a/tests/bugs164/pr268710/GenericAspect.aj b/tests/bugs164/pr268710/GenericAspect.aj new file mode 100644 index 000000000..b4df9fd6e --- /dev/null +++ b/tests/bugs164/pr268710/GenericAspect.aj @@ -0,0 +1,16 @@ +/** + * + */ +package none; + +/** + * @author Dawid Pytel + * + */ +public abstract aspect GenericAspect<T> { + + interface SomeInterface { + } + + pointcut SomeConstructor(SomeInterface var) : execution(SomeInterface+.new(..)) && this(var); +} diff --git a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java index 1afbf4b42..bc78b7108 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java @@ -38,6 +38,10 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("generics aspects npe"); } + public void testGenericAspectsNpe_pr268710() { + runTest("generics aspects incorrect error"); + } + public void testGenericsItdNpe_pr267559() { runTest("generics and itd npe"); } diff --git a/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml b/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml index ae770bbae..371b206c0 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml +++ b/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml @@ -2,10 +2,18 @@ <suite> + <ajc-test dir="bugs164/pr268710" title="generics aspects incorrect error"> + <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5"/> + <run class="none.ConcreteAspect"> + <stdout> + <line text="Building an object class none.C"/> + <line text="C.init"/> + </stdout> + </run> + </ajc-test> + <ajc-test dir="bugs164/pr268689" title="generics aspects npe"> - <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5"> - <message kind="error" line="15" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/> - </compile> + <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5"/> </ajc-test> <ajc-test dir="bugs164/pr267559" title="generics and itd npe"> |