]> source.dussan.org Git - aspectj.git/commitdiff
matthews generic aspect: testcode for pr113947
authoraclement <aclement>
Thu, 27 Oct 2005 16:00:45 +0000 (16:00 +0000)
committeraclement <aclement>
Thu, 27 Oct 2005 16:00:45 +0000 (16:00 +0000)
14 files changed:
tests/bugs150/pr113947/case1/AbstractListSupport.java [new file with mode: 0644]
tests/bugs150/pr113947/case1/AnotherItem.java [new file with mode: 0644]
tests/bugs150/pr113947/case1/Item.java [new file with mode: 0644]
tests/bugs150/pr113947/case1/LinkedList.java [new file with mode: 0644]
tests/bugs150/pr113947/case1/LinkedListItem.java [new file with mode: 0644]
tests/bugs150/pr113947/case1/ListItem.java [new file with mode: 0644]
tests/bugs150/pr113947/case1/StringList.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/AbstractListSupport.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/AnotherItem.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/Item.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/LinkedList.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/LinkedListItem.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/ListItem.java [new file with mode: 0644]
tests/bugs150/pr113947/case2/StringList.java [new file with mode: 0644]

diff --git a/tests/bugs150/pr113947/case1/AbstractListSupport.java b/tests/bugs150/pr113947/case1/AbstractListSupport.java
new file mode 100644 (file)
index 0000000..facc7e3
--- /dev/null
@@ -0,0 +1,16 @@
+
+public abstract aspect AbstractListSupport<I,M extends I> {
+
+       declare parents : @LinkedListItem * implements M;
+
+       private M M.next;
+
+       public I M.getNext () {
+               return next;
+       }
+
+       public void M.setNext (M item) {
+               next = item;
+       }
+
+}
diff --git a/tests/bugs150/pr113947/case1/AnotherItem.java b/tests/bugs150/pr113947/case1/AnotherItem.java
new file mode 100644 (file)
index 0000000..7dc0851
--- /dev/null
@@ -0,0 +1,5 @@
+
+@LinkedListItem
+public class AnotherItem {
+
+}
diff --git a/tests/bugs150/pr113947/case1/Item.java b/tests/bugs150/pr113947/case1/Item.java
new file mode 100644 (file)
index 0000000..fe9a223
--- /dev/null
@@ -0,0 +1,5 @@
+
+public class Item {
+
+
+}
diff --git a/tests/bugs150/pr113947/case1/LinkedList.java b/tests/bugs150/pr113947/case1/LinkedList.java
new file mode 100644 (file)
index 0000000..a20507a
--- /dev/null
@@ -0,0 +1,145 @@
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class LinkedList implements List<ListItem> {
+
+       public boolean add (ListItem item) {
+               MutableListItem listItem = (MutableListItem)item;
+               listItem.setNext(null);
+               
+               return true;
+       }
+
+       public ListItem get (int i) {
+               return new Item();
+       }
+
+       public void add(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean addAll(Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean addAll(int index, Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public void clear() {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean contains(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean containsAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public int indexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public boolean isEmpty() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public Iterator<ListItem> iterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int lastIndexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public ListIterator<ListItem> listIterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListIterator<ListItem> listIterator(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListItem remove(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public boolean remove(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean removeAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean retainAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public ListItem set(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int size() {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public List<ListItem> subList(int fromIndex, int toIndex) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public Object[] toArray() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public <T> T[] toArray(T[] a) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+       
+       private interface MutableListItem extends ListItem {
+               public void setNext (MutableListItem o);
+       }
+       
+       private static aspect LinkedListSupport {
+               declare parents : Item implements MutableListItem;
+               declare parents : @LinkedListItem * implements MutableListItem;
+
+               private MutableListItem MutableListItem.next;
+               
+               public ListItem MutableListItem.getNext () {
+                       return next;
+               }
+               
+               public void MutableListItem.setNext (MutableListItem item) {
+                       next = item;
+               }
+       }
+       
+       
+}
diff --git a/tests/bugs150/pr113947/case1/LinkedListItem.java b/tests/bugs150/pr113947/case1/LinkedListItem.java
new file mode 100644 (file)
index 0000000..1804775
--- /dev/null
@@ -0,0 +1,4 @@
+
+public @interface LinkedListItem {
+
+}
diff --git a/tests/bugs150/pr113947/case1/ListItem.java b/tests/bugs150/pr113947/case1/ListItem.java
new file mode 100644 (file)
index 0000000..bc1651d
--- /dev/null
@@ -0,0 +1,5 @@
+
+public interface ListItem {
+
+       public ListItem getNext ();
+}
diff --git a/tests/bugs150/pr113947/case1/StringList.java b/tests/bugs150/pr113947/case1/StringList.java
new file mode 100644 (file)
index 0000000..0692185
--- /dev/null
@@ -0,0 +1,126 @@
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+
+public class StringList implements List<ListItem> {
+
+       public void add(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean add(ListItem o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean addAll(Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean addAll(int index, Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public void clear() {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean contains(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean containsAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public ListItem get(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int indexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public boolean isEmpty() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public Iterator<ListItem> iterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int lastIndexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public ListIterator<ListItem> listIterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListIterator<ListItem> listIterator(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListItem remove(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public boolean remove(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean removeAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean retainAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public ListItem set(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int size() {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public List<ListItem> subList(int fromIndex, int toIndex) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public Object[] toArray() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public <T> T[] toArray(T[] a) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+
+}
diff --git a/tests/bugs150/pr113947/case2/AbstractListSupport.java b/tests/bugs150/pr113947/case2/AbstractListSupport.java
new file mode 100644 (file)
index 0000000..6b9e647
--- /dev/null
@@ -0,0 +1,23 @@
+
+public abstract aspect AbstractListSupport<I,M extends I> {
+
+  declare parents : @LinkedListItem * implements M;
+
+
+  // Interface
+  interface ListInterface<Item> {
+    Item getNext();
+    void setNext(Item item);
+  }
+    
+  private K ListInterface<K>.next;
+
+  public K ListInterface<K>.getNext () {
+    return next;
+  }
+
+  public void ListInterface<K>.setNext (K item) {
+    next = item;
+  }
+
+}
diff --git a/tests/bugs150/pr113947/case2/AnotherItem.java b/tests/bugs150/pr113947/case2/AnotherItem.java
new file mode 100644 (file)
index 0000000..7dc0851
--- /dev/null
@@ -0,0 +1,5 @@
+
+@LinkedListItem
+public class AnotherItem {
+
+}
diff --git a/tests/bugs150/pr113947/case2/Item.java b/tests/bugs150/pr113947/case2/Item.java
new file mode 100644 (file)
index 0000000..fe9a223
--- /dev/null
@@ -0,0 +1,5 @@
+
+public class Item {
+
+
+}
diff --git a/tests/bugs150/pr113947/case2/LinkedList.java b/tests/bugs150/pr113947/case2/LinkedList.java
new file mode 100644 (file)
index 0000000..a20507a
--- /dev/null
@@ -0,0 +1,145 @@
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class LinkedList implements List<ListItem> {
+
+       public boolean add (ListItem item) {
+               MutableListItem listItem = (MutableListItem)item;
+               listItem.setNext(null);
+               
+               return true;
+       }
+
+       public ListItem get (int i) {
+               return new Item();
+       }
+
+       public void add(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean addAll(Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean addAll(int index, Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public void clear() {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean contains(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean containsAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public int indexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public boolean isEmpty() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public Iterator<ListItem> iterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int lastIndexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public ListIterator<ListItem> listIterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListIterator<ListItem> listIterator(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListItem remove(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public boolean remove(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean removeAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean retainAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public ListItem set(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int size() {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public List<ListItem> subList(int fromIndex, int toIndex) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public Object[] toArray() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public <T> T[] toArray(T[] a) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+       
+       private interface MutableListItem extends ListItem {
+               public void setNext (MutableListItem o);
+       }
+       
+       private static aspect LinkedListSupport {
+               declare parents : Item implements MutableListItem;
+               declare parents : @LinkedListItem * implements MutableListItem;
+
+               private MutableListItem MutableListItem.next;
+               
+               public ListItem MutableListItem.getNext () {
+                       return next;
+               }
+               
+               public void MutableListItem.setNext (MutableListItem item) {
+                       next = item;
+               }
+       }
+       
+       
+}
diff --git a/tests/bugs150/pr113947/case2/LinkedListItem.java b/tests/bugs150/pr113947/case2/LinkedListItem.java
new file mode 100644 (file)
index 0000000..1804775
--- /dev/null
@@ -0,0 +1,4 @@
+
+public @interface LinkedListItem {
+
+}
diff --git a/tests/bugs150/pr113947/case2/ListItem.java b/tests/bugs150/pr113947/case2/ListItem.java
new file mode 100644 (file)
index 0000000..bc1651d
--- /dev/null
@@ -0,0 +1,5 @@
+
+public interface ListItem {
+
+       public ListItem getNext ();
+}
diff --git a/tests/bugs150/pr113947/case2/StringList.java b/tests/bugs150/pr113947/case2/StringList.java
new file mode 100644 (file)
index 0000000..0692185
--- /dev/null
@@ -0,0 +1,126 @@
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+
+public class StringList implements List<ListItem> {
+
+       public void add(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean add(ListItem o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean addAll(Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean addAll(int index, Collection<? extends ListItem> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public void clear() {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public boolean contains(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean containsAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public ListItem get(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int indexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public boolean isEmpty() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public Iterator<ListItem> iterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int lastIndexOf(Object o) {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public ListIterator<ListItem> listIterator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListIterator<ListItem> listIterator(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public ListItem remove(int index) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public boolean remove(Object o) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean removeAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public boolean retainAll(Collection<?> c) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       public ListItem set(int index, ListItem element) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public int size() {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       public List<ListItem> subList(int fromIndex, int toIndex) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public Object[] toArray() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public <T> T[] toArray(T[] a) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+
+}