]> source.dussan.org Git - aspectj.git/commitdiff
171953#1 - test and fix for generic method introduction and compilation errors varyin...
authoraclement <aclement>
Tue, 20 Feb 2007 16:09:22 +0000 (16:09 +0000)
committeraclement <aclement>
Tue, 20 Feb 2007 16:09:22 +0000 (16:09 +0000)
tests/bugs160/pr171953_2/test/AbstractProcessor.java [new file with mode: 0644]
tests/bugs160/pr171953_2/test/ListFactory.java [new file with mode: 0644]
tests/bugs160/pr171953_2/test/ListFactoryAspect.aj [new file with mode: 0644]
tests/bugs160/pr171953_2/test/ListFactoryConsumer.java [new file with mode: 0644]
tests/bugs160/pr171953_2/test/Processor.java [new file with mode: 0644]
tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
tests/src/org/aspectj/systemtest/ajc160/ajc160.xml

diff --git a/tests/bugs160/pr171953_2/test/AbstractProcessor.java b/tests/bugs160/pr171953_2/test/AbstractProcessor.java
new file mode 100644 (file)
index 0000000..008fba1
--- /dev/null
@@ -0,0 +1,5 @@
+package test;
+
+public abstract class AbstractProcessor implements Processor {
+
+}
diff --git a/tests/bugs160/pr171953_2/test/ListFactory.java b/tests/bugs160/pr171953_2/test/ListFactory.java
new file mode 100644 (file)
index 0000000..473ccac
--- /dev/null
@@ -0,0 +1,9 @@
+package test;
+
+import java.util.List;
+
+public interface ListFactory {
+
+       <T> List<T> createList();
+       <T> List<T> createList(int initialCapacity);
+}
diff --git a/tests/bugs160/pr171953_2/test/ListFactoryAspect.aj b/tests/bugs160/pr171953_2/test/ListFactoryAspect.aj
new file mode 100644 (file)
index 0000000..acfc27e
--- /dev/null
@@ -0,0 +1,30 @@
+package test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public aspect ListFactoryAspect {
+
+       private ListFactory listFactory = new ListFactory() {
+               public <T> List<T> createList() {
+                       return new ArrayList<T>();
+               };
+               public <T> List<T> createList(int initialCapacity) {
+                       return new ArrayList<T>();
+               };
+       };
+       
+       declare parents: Processor implements ListFactoryConsumer;
+       
+       public ListFactory ListFactoryConsumer.getListFactory() {
+               return ListFactoryAspect.aspectOf().listFactory;
+       }
+       
+       public <T> List<T> ListFactoryConsumer.createList() {
+               return getListFactory().<T>createList();
+       }
+       
+       public <T> List<T> ListFactoryConsumer.createList(int initialCapacity) {
+               return getListFactory().<T>createList(initialCapacity);
+       }
+}
diff --git a/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java b/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java
new file mode 100644 (file)
index 0000000..41747d9
--- /dev/null
@@ -0,0 +1,6 @@
+package test;
+
+public interface ListFactoryConsumer {
+
+       ListFactory getListFactory();
+}
diff --git a/tests/bugs160/pr171953_2/test/Processor.java b/tests/bugs160/pr171953_2/test/Processor.java
new file mode 100644 (file)
index 0000000..c76cdaa
--- /dev/null
@@ -0,0 +1,5 @@
+package test;
+
+public interface Processor {
+
+}
diff --git a/tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java b/tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java
new file mode 100644 (file)
index 0000000..ab1ec7c
--- /dev/null
@@ -0,0 +1,16 @@
+package test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SimpleListFactoryConsumer extends AbstractProcessor {
+
+       public void run() {
+               //List<List<String>> list1 = getListFactory().createList();
+               List<List<String>> list2 = this.createList();
+       }
+       
+       public static void main(String[] args) {
+               new SimpleListFactoryConsumer().run();
+       }
+}
index eb6c5a11671ca88c54ff7867c4a5bebd12bd0a34..e371e5e5ef17a533296547a40d77133a96d70718 100644 (file)
@@ -21,6 +21,8 @@ import junit.framework.Test;
  */
 public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
+  public void testGenericMethodsAndOrdering_ok_pr171953_2() { runTest("problem with generic methods and ordering - ok");}
+  public void testGenericMethodsAndOrdering_bad_pr171953_2() { runTest("problem with generic methods and ordering - bad");}
   public void testItdAndJoinpointSignatureCollection_ok_pr171953() { runTest("problem with itd and join point signature collection - ok");}
   public void testItdAndJoinpointSignatureCollection_bad_pr171953() { runTest("problem with itd and join point signature collection - bad");}
   public void testGenericMethodsAndItds_pr171952() { runTest("generic methods and ITDs");}
index 792f59c5d0650f64b3f2c906c4d417e67192982b..671f3ad6ddc3c397af01e459d0e98539e3da184a 100644 (file)
@@ -5,6 +5,16 @@
 
  <!-- first section - dont need a 1.6 vm but fixed in the 1.6 branch of AspectJ -->
  
+   <ajc-test dir="bugs160/pr171953_2" title="problem with generic methods and ordering - ok">
+        <compile options="-1.5" files="test/ListFactoryAspect.aj, test/AbstractProcessor.java,test/ListFactory.java,test/ListFactoryConsumer.java,test/Processor.java,test/SimpleListFactoryConsumer.java">
+        </compile>
+   </ajc-test>
+   
+   <ajc-test dir="bugs160/pr171953_2" title="problem with generic methods and ordering - bad">
+        <compile options="-1.5" files="test/ListFactory.java,test/ListFactoryConsumer.java,test/SimpleListFactoryConsumer.java,test/Processor.java,test/ListFactoryAspect.aj,test/AbstractProcessor.java">
+        </compile>
+   </ajc-test>
+
    <ajc-test dir="bugs160/pr171953" title="problem with itd and join point signature collection - bad">
      <compile options="-1.5 -showWeaveInfo" files="test/AbstractExecutable.java,test/AnotherExecutable.java,test/Executable.java,test/ExecutionAspect.aj,test/SecondTestExecutable.java test/SubTestExecutable.java test/TestExecutable.java">
        <message kind="weave" text="Join point 'method-execution(void test.SecondTestExecutable.execute())' in Type 'test.SecondTestExecutable' (SecondTestExecutable.java:5) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>