From 7d5002ad52c86eefdf58535310fb41f042206d11 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 16 Jun 2005 08:30:14 +0000 Subject: Fix and tests for bug 100227: [generics][itds] inner class with generic enclosing class --- tests/bugs150/pr100227.aj | 33 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc150/Ajc150Tests.java | 7 +++-- tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 12 ++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 tests/bugs150/pr100227.aj (limited to 'tests') diff --git a/tests/bugs150/pr100227.aj b/tests/bugs150/pr100227.aj new file mode 100644 index 000000000..b7c899b0f --- /dev/null +++ b/tests/bugs150/pr100227.aj @@ -0,0 +1,33 @@ +class Outer { + class Inner {public void p() {System.err.println("Outer.Inner.p() executing");} } + public void m() { new Inner().p(); } +} + +class Generic_Outer { + class Inner {public void p() {System.err.println("Generic_Outer.Inner.p() executing");} } + + public void m() { new Inner().p(); } +} + +aspect Injector { + int Outer.outer = 1; + int Outer.Inner.inner = 2; + int Generic_Outer.outer = 3; + int Generic_Outer.Inner.inner = 4; + + before(Object o): execution(* p()) && this(o) { + if (o instanceof Outer.Inner) { + System.err.println("Outer.Inner.inner="+((Outer.Inner)o).inner); + } + if (o instanceof Generic_Outer.Inner) { + System.err.println("Generic_Outer.Inner.inner="+((Generic_Outer.Inner)o).inner); + } + } +} + +public class pr100227 { + public static void main(String []argv) { + new Outer().m(); + new Generic_Outer().m(); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index f3bf1c418..1292a7475 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -180,9 +180,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testGenerics_pr99089() {runTest("ArrayIndexOutOfBoundsException - Generics in privileged aspects");} - public void testItdGenerics_pr99228() {runTest("ITD of a field into a generic class");} - public void testItdGenerics_pr98320() {runTest("intertype with nested generic type");} - + public void testItdGenerics_pr99228() {runTest("ITD of a field into a generic class");} + public void testItdGenerics_pr98320() {runTest("intertype with nested generic type");} + public void testItdGenerics_pr100227() {runTest("inner class with generic enclosing class");} + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 00ab89eb9..48cadc36e 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2275,6 +2275,18 @@ + + + + + + + + + + + + // end of generic bugs // generic aspects -- cgit v1.2.3