From 1c9611faa2341eb315045ce1ab0df0269a7ab423 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 16 Mar 2009 18:40:12 +0000 Subject: [PATCH] 268710: test and fix: marker interface within generic aspect --- tests/bugs164/pr268710/ConcreteAspect.aj | 26 +++++++++++++++++++ tests/bugs164/pr268710/GenericAspect.aj | 16 ++++++++++++ .../systemtest/ajc164/Ajc164Tests.java | 4 +++ .../org/aspectj/systemtest/ajc164/ajc164.xml | 14 +++++++--- 4 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 tests/bugs164/pr268710/ConcreteAspect.aj create mode 100644 tests/bugs164/pr268710/GenericAspect.aj 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 { + + 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 { + + 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 @@ + + + + + + + + + + - - - + -- 2.39.5