summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-01-23 10:47:29 +0000
committeraclement <aclement>2006-01-23 10:47:29 +0000
commit8676df9bca4e5e169206f314c8ad5d3da38bc28e (patch)
tree7469cd7640ddc92294773d2aba941e2c0adb85bf /tests
parentb537e726b3ab16bf30f972e87d768aba0eba31c7 (diff)
downloadaspectj-8676df9bca4e5e169206f314c8ad5d3da38bc28e.tar.gz
aspectj-8676df9bca4e5e169206f314c8ad5d3da38bc28e.zip
test and fix for pr124803 - mixing numbers of tvars/tparams in a hierarchy
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs151/pr124803/Test.java19
-rw-r--r--tests/bugs151/pr124803/Test2.java19
-rw-r--r--tests/bugs151/pr124803/TestAspect.java8
-rw-r--r--tests/bugs151/pr124803/TestAspect2.java8
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/ajc151.xml22
6 files changed, 78 insertions, 0 deletions
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<T extends Number> {
+ public void foo(T p);
+}
+
+
+interface Generic2<T extends Number, Y extends Number> extends Generic1<T> {
+ public void foo2(Y p);
+}
+
+public class Test<Y extends Number> implements Generic2<Y,Y>{
+ public void foo2(Y p) { }
+ public void foo(Y p) { }
+
+ public static void main(String []argv) {
+ Test<Integer> t = new Test<Integer>();
+ 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<T extends Number> {
+ public void foo(T p) { }
+}
+
+
+class Generic2<T extends Number, Y extends Number> extends Generic1<T> {
+ public void foo2(Y p) {}
+}
+
+public class Test2<Y extends Number> extends Generic2<Y,Y>{
+ public void foo2(Y p) { }
+ public void foo(Y p) { }
+
+ public static void main(String []argv) {
+ Test2<Integer> t = new Test2<Integer>();
+ 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 @@
</compile>
</ajc-test>
+ <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables">
+ <compile files="Test.java,TestAspect.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-execution(void Test.foo(java.lang.Number))' in Type 'Test' (Test.java:12) advised by after advice from 'TestAspect' (TestAspect.java:4)"/>
+ </compile>
+ <run class="Test">
+ <stderr>
+ <line text="Aspects:execution(void Test.foo(Number))"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables - classes">
+ <compile files="Test2.java,TestAspect2.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-execution(void Test2.foo(java.lang.Number))' in Type 'Test2' (Test2.java:12) advised by after advice from 'TestAspect2' (TestAspect2.java:4)"/>
+ <message kind="weave" text="Join point 'method-execution(void Generic1.foo(java.lang.Number))' in Type 'Generic1' (Test2.java:2) advised by after advice from 'TestAspect2' (TestAspect2.java:4) [with runtime test]"/>
+ </compile>
+ <run class="Test2">
+ <stderr>
+ <line text="Aspects:execution(void Test2.foo(Number))"/>
+ </stderr>
+ </run>
+ </ajc-test>
</suite> \ No newline at end of file