From 8676df9bca4e5e169206f314c8ad5d3da38bc28e Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 23 Jan 2006 10:47:29 +0000 Subject: test and fix for pr124803 - mixing numbers of tvars/tparams in a hierarchy --- tests/bugs151/pr124803/Test.java | 19 +++++++++++++++++++ tests/bugs151/pr124803/Test2.java | 19 +++++++++++++++++++ tests/bugs151/pr124803/TestAspect.java | 8 ++++++++ tests/bugs151/pr124803/TestAspect2.java | 8 ++++++++ .../org/aspectj/systemtest/ajc151/Ajc151Tests.java | 2 ++ tests/src/org/aspectj/systemtest/ajc151/ajc151.xml | 22 ++++++++++++++++++++++ 6 files changed, 78 insertions(+) create mode 100644 tests/bugs151/pr124803/Test.java create mode 100644 tests/bugs151/pr124803/Test2.java create mode 100644 tests/bugs151/pr124803/TestAspect.java create mode 100644 tests/bugs151/pr124803/TestAspect2.java (limited to 'tests') diff --git a/tests/bugs151/pr124803/Test.java b/tests/bugs151/pr124803/Test.java new file mode 100644 index 000000000..5c4784cac --- /dev/null +++ b/tests/bugs151/pr124803/Test.java @@ -0,0 +1,19 @@ +interface Generic1 { + public void foo(T p); +} + + +interface Generic2 extends Generic1 { + public void foo2(Y p); +} + +public class Test implements Generic2{ + public void foo2(Y p) { } + public void foo(Y p) { } + + public static void main(String []argv) { + Test t = new Test(); + t.foo(7); + t.foo2(9); + } +} diff --git a/tests/bugs151/pr124803/Test2.java b/tests/bugs151/pr124803/Test2.java new file mode 100644 index 000000000..58a364573 --- /dev/null +++ b/tests/bugs151/pr124803/Test2.java @@ -0,0 +1,19 @@ +class Generic1 { + public void foo(T p) { } +} + + +class Generic2 extends Generic1 { + public void foo2(Y p) {} +} + +public class Test2 extends Generic2{ + public void foo2(Y p) { } + public void foo(Y p) { } + + public static void main(String []argv) { + Test2 t = new Test2(); + t.foo(7); + t.foo2(9); + } +} diff --git a/tests/bugs151/pr124803/TestAspect.java b/tests/bugs151/pr124803/TestAspect.java new file mode 100644 index 000000000..c22b8f966 --- /dev/null +++ b/tests/bugs151/pr124803/TestAspect.java @@ -0,0 +1,8 @@ +public privileged aspect TestAspect { + pointcut TestInheritance(Test test) : target(test) && execution (* Generic1.*(..)); + + after (Test test) : TestInheritance(test) { + System.err.println("Aspects:"+thisJoinPoint); + } +} + diff --git a/tests/bugs151/pr124803/TestAspect2.java b/tests/bugs151/pr124803/TestAspect2.java new file mode 100644 index 000000000..62d7ab513 --- /dev/null +++ b/tests/bugs151/pr124803/TestAspect2.java @@ -0,0 +1,8 @@ +public privileged aspect TestAspect2 { + pointcut TestInheritance(Test2 test) : target(test) && execution (* Generic1.*(..)); + + after (Test2 test) : TestInheritance(test) { + System.err.println("Aspects:"+thisJoinPoint); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java index 6bf01d7f3..396f2ed85 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java @@ -22,6 +22,8 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testMemberTypesInGenericTypes_pr122458_2() { runTest("member types in generic types - 2");} public void testNPEOnDeclareAnnotation_pr123695() { runTest("Internal nullptr exception with complex declare annotation");} public void testHasMemberPackageProblem_pr124105() { runTest("hasMember problems with packages");} + public void testDifferentNumbersofTVars_pr124803() { runTest("generics and different numbers of type variables");} + public void testDifferentNumbersofTVars_pr124803_2() { runTest("generics and different numbers of type variables - classes");} ///////////////////////////////////////// public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml index 4fb00ce91..5c578a1d6 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml +++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml @@ -22,5 +22,27 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3