]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 125080 - mixing numbers of types in a generic type hierarchy
authoraclement <aclement>
Wed, 25 Jan 2006 10:43:34 +0000 (10:43 +0000)
committeraclement <aclement>
Wed, 25 Jan 2006 10:43:34 +0000 (10:43 +0000)
tests/bugs151/pr125080/Test.java [new file with mode: 0644]
tests/bugs151/pr125080/Test2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
tests/src/org/aspectj/systemtest/ajc151/ajc151.xml

diff --git a/tests/bugs151/pr125080/Test.java b/tests/bugs151/pr125080/Test.java
new file mode 100644 (file)
index 0000000..2beaa13
--- /dev/null
@@ -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 (file)
index 0000000..a6a02bd
--- /dev/null
@@ -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; }
+}
index 16fcdd2fa34d5d746e3c7853e650e723d879f6d8..cf2e4d7428e090107f687e6d8e0254a03441e617 100644 (file)
@@ -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() {
index 28e85d036041ef1c49815cb3ae1141ce91eb0ca3..b10528b45528a1ba2d5a5fdd85ef57e4cf8d5c3d 100644 (file)
     <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