From eaaf30a16026a8cffadc08b7eab3445c17348620 Mon Sep 17 00:00:00 2001
From: aclement <aclement>
Date: Mon, 17 Oct 2005 08:27:16 +0000
Subject: testcode for 110307

---
 tests/bugs150/pr110307/Case1.java | 42 ++++++++++++++++++++++++++++++++++
 tests/bugs150/pr110307/Case2.java | 48 +++++++++++++++++++++++++++++++++++++++
 tests/bugs150/pr110307/Case3.java | 16 +++++++++++++
 tests/bugs150/pr110307/Case4.java | 17 ++++++++++++++
 tests/bugs150/pr110307/Case5.java | 18 +++++++++++++++
 tests/bugs150/pr110307/Case6.java |  9 ++++++++
 6 files changed, 150 insertions(+)
 create mode 100644 tests/bugs150/pr110307/Case1.java
 create mode 100644 tests/bugs150/pr110307/Case2.java
 create mode 100644 tests/bugs150/pr110307/Case3.java
 create mode 100644 tests/bugs150/pr110307/Case4.java
 create mode 100644 tests/bugs150/pr110307/Case5.java
 create mode 100644 tests/bugs150/pr110307/Case6.java

(limited to 'tests/bugs150/pr110307')

diff --git a/tests/bugs150/pr110307/Case1.java b/tests/bugs150/pr110307/Case1.java
new file mode 100644
index 000000000..b0b3f8d66
--- /dev/null
+++ b/tests/bugs150/pr110307/Case1.java
@@ -0,0 +1,42 @@
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+class Product{}
+class ProductType{}
+
+interface AssociationSource<T> {
+
+  Link<T> getTarget();
+
+  void setTarget(Link<T> _target);
+
+}
+aspect ExtendProduct {
+       Link<T> AssociationSource._target = null;
+
+       public Link<T> AssociationSource.getTarget() {
+           return _target;
+       }
+
+       public void AssociationSource.setTarget(Link<T> _target) {
+           this._target = _target;
+       }
+
+       declare parents : ProductType implements AssociationSource<Product>;
+       declare parents : Product     implements AssociationSource<Branch>;
+       declare parents : Branch      implements AssociationSource<Revision>;
+}
+
+class Link<T> extends SoftReference {
+
+   @SuppressWarnings("unchecked")
+   Link(List<T> endPoints) {
+       super(endPoints);
+   }
+
+   @SuppressWarnings("unchecked")
+   public List<T> getEndPoints() {
+       return (List<T>)get();
+   }
+
+}
diff --git a/tests/bugs150/pr110307/Case2.java b/tests/bugs150/pr110307/Case2.java
new file mode 100644
index 000000000..f68ed57d7
--- /dev/null
+++ b/tests/bugs150/pr110307/Case2.java
@@ -0,0 +1,48 @@
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+class Product {}
+class ProductType{}
+class Branch {}
+class Revision {}
+
+interface AssociationSource<T> {
+
+  Link<T> getTarget();
+
+  void setTarget(Link<T> _target);
+
+}
+aspect ExtendProduct {
+       Link<T> AssociationSource<T>._target = null;
+
+       public Link<T> AssociationSource<T>.getTarget() {
+           return _target;
+       }
+
+       public void AssociationSource<T>.setTarget(Link<T> _target) {
+         this._target = _target;
+       }
+
+       declare parents : ProductType implements AssociationSource<Product>;
+/*
+       declare parents : Product     implements AssociationSource<Branch>;
+       declare parents : Branch      implements AssociationSource<Revision>;
+*/
+}
+
+class Link<T> {//extends SoftReference {
+
+/*   @SuppressWarnings("unchecked")
+   Link(List<T> endPoints) {
+       super(endPoints);
+   }
+
+   @SuppressWarnings("unchecked")
+   public List<T> getEndPoints() {
+       return (List<T>)get();
+   }
+*/
+
+}
diff --git a/tests/bugs150/pr110307/Case3.java b/tests/bugs150/pr110307/Case3.java
new file mode 100644
index 000000000..3392b051a
--- /dev/null
+++ b/tests/bugs150/pr110307/Case3.java
@@ -0,0 +1,16 @@
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+interface I<T> {
+}
+
+class A {
+}
+
+aspect X {
+
+  List<T> I<T>.foo() { return null; }  // should be ok...
+
+  declare parents: A implements I<String>;
+}
diff --git a/tests/bugs150/pr110307/Case4.java b/tests/bugs150/pr110307/Case4.java
new file mode 100644
index 000000000..dc67a9552
--- /dev/null
+++ b/tests/bugs150/pr110307/Case4.java
@@ -0,0 +1,17 @@
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+interface I<T> {
+}
+
+class A {
+  List<String> foo() { return null; }
+}
+
+aspect X {
+
+  List<T> I<T>.foo() { return null; }  // should be ok - A implements I<String>
+
+  declare parents: A implements I<String>;
+}
diff --git a/tests/bugs150/pr110307/Case5.java b/tests/bugs150/pr110307/Case5.java
new file mode 100644
index 000000000..ceb3936a6
--- /dev/null
+++ b/tests/bugs150/pr110307/Case5.java
@@ -0,0 +1,18 @@
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+interface I<T> {
+}
+
+class A {
+  // error, not compatible with List<String> from supertype
+  List<Integer> foo() { return null; } 
+}
+
+aspect X {
+
+  List<T> I<T>.foo() { return null; }
+
+  declare parents: A implements I<String>;
+}
diff --git a/tests/bugs150/pr110307/Case6.java b/tests/bugs150/pr110307/Case6.java
new file mode 100644
index 000000000..89b743051
--- /dev/null
+++ b/tests/bugs150/pr110307/Case6.java
@@ -0,0 +1,9 @@
+import java.util.*;
+
+class A<T> { } 
+
+
+aspect X {
+  List<T> A.n() { return null;}
+  List<N> A.m() { return null;}
+}
-- 
cgit v1.2.3