]> source.dussan.org Git - aspectj.git/commitdiff
case4 of Alex's bug ;)
authoraclement <aclement>
Thu, 17 Nov 2005 08:56:15 +0000 (08:56 +0000)
committeraclement <aclement>
Thu, 17 Nov 2005 08:56:15 +0000 (08:56 +0000)
tests/java5/generics/bugs/lists/case4/Bean.java [new file with mode: 0644]
tests/java5/generics/bugs/lists/case4/Identifiable.java [new file with mode: 0644]
tests/java5/generics/bugs/lists/case4/IdentifiableAspect.java [new file with mode: 0644]
tests/java5/generics/bugs/lists/case4/LongIdentifiable.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/java5/generics/bugs/lists/case4/Bean.java b/tests/java5/generics/bugs/lists/case4/Bean.java
new file mode 100644 (file)
index 0000000..6444e4a
--- /dev/null
@@ -0,0 +1,2 @@
+
+public class Bean {}
diff --git a/tests/java5/generics/bugs/lists/case4/Identifiable.java b/tests/java5/generics/bugs/lists/case4/Identifiable.java
new file mode 100644 (file)
index 0000000..645ee36
--- /dev/null
@@ -0,0 +1,5 @@
+public interface Identifiable<T> {
+  T getId();
+
+  void setId(T t);
+}
diff --git a/tests/java5/generics/bugs/lists/case4/IdentifiableAspect.java b/tests/java5/generics/bugs/lists/case4/IdentifiableAspect.java
new file mode 100644 (file)
index 0000000..26b162f
--- /dev/null
@@ -0,0 +1,20 @@
+public aspect IdentifiableAspect {
+    declare parents: Bean implements LongIdentifiable;
+
+    private T Identifiable<T>.m_id;
+
+    public T Identifiable<T>.getId() {
+        return m_id;
+    }
+
+    public void Identifiable<T>.setId(T id) {
+        m_id= id;
+    }
+
+  public static void main(String []argv) {
+    Bean b = new Bean();
+    b.setId(37L);
+    long l = b.getId();
+    if (l!=37L) throw new RuntimeException("id should be 37");
+  }
+}
diff --git a/tests/java5/generics/bugs/lists/case4/LongIdentifiable.java b/tests/java5/generics/bugs/lists/case4/LongIdentifiable.java
new file mode 100644 (file)
index 0000000..37fa762
--- /dev/null
@@ -0,0 +1,2 @@
+public interface LongIdentifiable extends Identifiable<Long> {
+}
index f6f142f21652edda4b04d83a34bdbf03885b5858..be7ec7eb549719101f9d642194c127696e85886e 100644 (file)
@@ -49,6 +49,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
   */
   
+//  public void testGenericAspects_pr115237() { runTest("aspectOf and generic aspects");}
   public void testClassFormatError_pr114436() { runTest("ClassFormatError binary weaving perthis");}
   public void testParserException_pr115788() { runTest("parser exception");}
   public void testPossibleStaticImports_pr113066_1() { runTest("possible static imports bug - 1");}
index 83c1b59cc6003132c34282cb1957b5fb1ef66adf..3791429edcd9146496a90640b2d12b338d0c7c90 100644 (file)
@@ -211,6 +211,7 @@ public class GenericsTests extends XMLBasedAjcTestCase {
        public void testGenericsOverrides_1() { runTest("generics and ITD overrides - 1"); }
        public void testGenericsOverrides_2() { runTest("generics and ITD overrides - 2"); }
        public void testGenericsOverrides_3() { runTest("generics and ITD overrides - 3"); }
+       public void testGenericsOverrides_4() { runTest("generics and ITD overrides - 4"); }
        
        public void testPR88606() {
                runTest("Parameterized types on introduced fields not correctly recognized");
index 971e0ee481ec3c841ae911e115b66bebc5d61111..a2075580f988f2d0ac17958d48de5c26d9c54795 100644 (file)
         </compile>
         <run class="IdentifiableAspect"/>
     </ajc-test> 
+    
+    <ajc-test dir="java5/generics/bugs/lists/case4" title="generics and ITD overrides - 4">
+        <compile files="Identifiable.java,Bean.java,LongIdentifiable.java,IdentifiableAspect.java" options="-1.5">
+        </compile>
+        <run class="IdentifiableAspect"/>
+    </ajc-test> 
 
     <!-- Currently a warning doesn't occur if the annotation is already on the field
          (see bug 113029). If this is fixed, need to add check for this warning to this