From 1aef8a8cf7dfbaa164a464ee5b10e7688b6a0964 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 20 Feb 2007 16:09:22 +0000 Subject: [PATCH] 171953#1 - test and fix for generic method introduction and compilation errors varying depending on order of source file processing --- .../pr171953_2/test/AbstractProcessor.java | 5 ++++ .../bugs160/pr171953_2/test/ListFactory.java | 9 ++++++ .../pr171953_2/test/ListFactoryAspect.aj | 30 +++++++++++++++++++ .../pr171953_2/test/ListFactoryConsumer.java | 6 ++++ tests/bugs160/pr171953_2/test/Processor.java | 5 ++++ .../test/SimpleListFactoryConsumer.java | 16 ++++++++++ .../systemtest/ajc160/Ajc160Tests.java | 2 ++ .../org/aspectj/systemtest/ajc160/ajc160.xml | 10 +++++++ 8 files changed, 83 insertions(+) create mode 100644 tests/bugs160/pr171953_2/test/AbstractProcessor.java create mode 100644 tests/bugs160/pr171953_2/test/ListFactory.java create mode 100644 tests/bugs160/pr171953_2/test/ListFactoryAspect.aj create mode 100644 tests/bugs160/pr171953_2/test/ListFactoryConsumer.java create mode 100644 tests/bugs160/pr171953_2/test/Processor.java create mode 100644 tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java diff --git a/tests/bugs160/pr171953_2/test/AbstractProcessor.java b/tests/bugs160/pr171953_2/test/AbstractProcessor.java new file mode 100644 index 000000000..008fba159 --- /dev/null +++ b/tests/bugs160/pr171953_2/test/AbstractProcessor.java @@ -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 index 000000000..473ccac20 --- /dev/null +++ b/tests/bugs160/pr171953_2/test/ListFactory.java @@ -0,0 +1,9 @@ +package test; + +import java.util.List; + +public interface ListFactory { + + List createList(); + List 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 index 000000000..acfc27e70 --- /dev/null +++ b/tests/bugs160/pr171953_2/test/ListFactoryAspect.aj @@ -0,0 +1,30 @@ +package test; + +import java.util.ArrayList; +import java.util.List; + +public aspect ListFactoryAspect { + + private ListFactory listFactory = new ListFactory() { + public List createList() { + return new ArrayList(); + }; + public List createList(int initialCapacity) { + return new ArrayList(); + }; + }; + + declare parents: Processor implements ListFactoryConsumer; + + public ListFactory ListFactoryConsumer.getListFactory() { + return ListFactoryAspect.aspectOf().listFactory; + } + + public List ListFactoryConsumer.createList() { + return getListFactory().createList(); + } + + public List ListFactoryConsumer.createList(int initialCapacity) { + return getListFactory().createList(initialCapacity); + } +} diff --git a/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java b/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java new file mode 100644 index 000000000..41747d902 --- /dev/null +++ b/tests/bugs160/pr171953_2/test/ListFactoryConsumer.java @@ -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 index 000000000..c76cdaaf9 --- /dev/null +++ b/tests/bugs160/pr171953_2/test/Processor.java @@ -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 index 000000000..ab1ec7cf7 --- /dev/null +++ b/tests/bugs160/pr171953_2/test/SimpleListFactoryConsumer.java @@ -0,0 +1,16 @@ +package test; + +import java.util.ArrayList; +import java.util.List; + +public class SimpleListFactoryConsumer extends AbstractProcessor { + + public void run() { + //List> list1 = getListFactory().createList(); + List> list2 = this.createList(); + } + + public static void main(String[] args) { + new SimpleListFactoryConsumer().run(); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java index eb6c5a116..e371e5e5e 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java @@ -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");} diff --git a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml index 792f59c5d..671f3ad6d 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml +++ b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml @@ -5,6 +5,16 @@ + + + + + + + + + + -- 2.39.5