diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr100227.aj | 33 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 7 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 12 |
3 files changed, 49 insertions, 3 deletions
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<T> { + 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<String>().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 @@ <compile files="PR95992.java" options="-1.5"/> </ajc-test> + <ajc-test dir="bugs150" pr="100227" title="inner class with generic enclosing class"> + <compile files="pr100227.aj" options="-1.5"/> + <run class="pr100227"> + <stderr> + <line text="Outer.Inner.inner=2"/> + <line text="Outer.Inner.p() executing"/> + <line text="Generic_Outer.Inner.inner=4"/> + <line text="Generic_Outer.Inner.p() executing"/> + </stderr> + </run> + </ajc-test> + // end of generic bugs // generic aspects |