--- /dev/null
+package test;
+
+public abstract class AbstractProcessor implements Processor {
+
+}
--- /dev/null
+package test;
+
+import java.util.List;
+
+public interface ListFactory {
+
+ <T> List<T> createList();
+ <T> List<T> createList(int initialCapacity);
+}
--- /dev/null
+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);
+ }
+}
--- /dev/null
+package test;
+
+public interface ListFactoryConsumer {
+
+ ListFactory getListFactory();
+}
--- /dev/null
+package test;
+
+public interface Processor {
+
+}
--- /dev/null
+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();
+ }
+}
*/
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");}
<!-- 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)"/>