diff options
author | aclement <aclement> | 2006-01-25 10:43:34 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-01-25 10:43:34 +0000 |
commit | 244a1c78371fab02a6b2a9937fcc27e6cf1bc61d (patch) | |
tree | d21366e9a8fe2413a517d56aa6b78f0121c8dfa8 | |
parent | 8ce00642b4c8b1bb0233125e64f798283ebb3e90 (diff) | |
download | aspectj-244a1c78371fab02a6b2a9937fcc27e6cf1bc61d.tar.gz aspectj-244a1c78371fab02a6b2a9937fcc27e6cf1bc61d.zip |
test and fix for 125080 - mixing numbers of types in a generic type hierarchy
-rw-r--r-- | tests/bugs151/pr125080/Test.java | 11 | ||||
-rw-r--r-- | tests/bugs151/pr125080/Test2.java | 20 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java | 14 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc151/ajc151.xml | 10 |
4 files changed, 55 insertions, 0 deletions
diff --git a/tests/bugs151/pr125080/Test.java b/tests/bugs151/pr125080/Test.java new file mode 100644 index 000000000..2beaa138b --- /dev/null +++ b/tests/bugs151/pr125080/Test.java @@ -0,0 +1,11 @@ +import java.util.*; + +interface AspectInterface<T, S> { } + +abstract aspect AbstractAspect<T> implements AspectInterface<T, Integer> {} + +aspect ConcreteAspect extends AbstractAspect<String> { + + public static void main(String []argv) { + } +} diff --git a/tests/bugs151/pr125080/Test2.java b/tests/bugs151/pr125080/Test2.java new file mode 100644 index 000000000..a6a02bdaf --- /dev/null +++ b/tests/bugs151/pr125080/Test2.java @@ -0,0 +1,20 @@ +import java.util.*; + +abstract aspect AbstractAspect<T> implements AspectInterface<T, Integer> {} + +interface AspectInterface<T, S extends Number> { } + +aspect ConcreteAspect extends AbstractAspect<Student> { + public static void main(String []argv) { + } +} + +class Student { + private String name; + + public Student(String n) { + name = n; + } + + public String toString() { return name; } +} diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java index 16fcdd2fa..cf2e4d742 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java @@ -14,6 +14,7 @@ import java.io.File; import junit.framework.Test; +import org.aspectj.systemtest.ajc150.GenericsTests; import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { @@ -30,6 +31,19 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { //public void testIncorrectlyReferencingPointcuts_pr122452() { runTest("incorrectly referencing pointcuts");} //public void testIncorrectlyReferencingPointcuts_pr122452_2() { runTest("incorrectly referencing pointcuts - 2");} + public void testMixingNumbersOfTypeParameters_pr125080() { + runTest("mixing numbers of type parameters"); + GenericsTests.verifyClassSignature(ajc,"AspectInterface","<T:Ljava/lang/Object;S:Ljava/lang/Object;>Ljava/lang/Object;"); + GenericsTests.verifyClassSignature(ajc,"AbstractAspect","<T:Ljava/lang/Object;>Ljava/lang/Object;LAspectInterface<TT;Ljava/lang/Integer;>;"); + GenericsTests.verifyClassSignature(ajc,"ConcreteAspect","LAbstractAspect<Ljava/lang/String;>;"); + } + + public void testMixingNumbersOfTypeParameters_pr125080_2() { + runTest("mixing numbers of type parameters - 2"); + GenericsTests.verifyClassSignature(ajc,"AspectInterface","<T:Ljava/lang/Object;S:Ljava/lang/Number;>Ljava/lang/Object;"); + GenericsTests.verifyClassSignature(ajc,"AbstractAspect","<T:Ljava/lang/Object;>Ljava/lang/Object;LAspectInterface<TT;Ljava/lang/Integer;>;"); + GenericsTests.verifyClassSignature(ajc,"ConcreteAspect","LAbstractAspect<LStudent;>;"); + } ///////////////////////////////////////// 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 28e85d036..b10528b45 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml +++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml @@ -77,5 +77,15 @@ <ajc-test dir="bugs151" title="incorrectly referencing pointcuts - 2"> <compile files="pr122452_2.aj" options="-1.5"/> </ajc-test> + + <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters"> + <compile files="Test.java" options="-1.5"/> + <run class="ConcreteAspect"/> + </ajc-test> + + <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters - 2"> + <compile files="Test2.java" options="-1.5"/> + <run class="ConcreteAspect"/> + </ajc-test> </suite>
\ No newline at end of file |