diff options
author | aclement <aclement> | 2005-10-17 08:27:16 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-10-17 08:27:16 +0000 |
commit | eaaf30a16026a8cffadc08b7eab3445c17348620 (patch) | |
tree | 97ec6ace320463ecaff7f787095a28db1a5877bb /tests/bugs150 | |
parent | 9f651ae391dea61c4a0ba903e33e8fd5655d98b1 (diff) | |
download | aspectj-eaaf30a16026a8cffadc08b7eab3445c17348620.tar.gz aspectj-eaaf30a16026a8cffadc08b7eab3445c17348620.zip |
testcode for 110307
Diffstat (limited to 'tests/bugs150')
-rw-r--r-- | tests/bugs150/pr110307/Case1.java | 42 | ||||
-rw-r--r-- | tests/bugs150/pr110307/Case2.java | 48 | ||||
-rw-r--r-- | tests/bugs150/pr110307/Case3.java | 16 | ||||
-rw-r--r-- | tests/bugs150/pr110307/Case4.java | 17 | ||||
-rw-r--r-- | tests/bugs150/pr110307/Case5.java | 18 | ||||
-rw-r--r-- | tests/bugs150/pr110307/Case6.java | 9 |
6 files changed, 150 insertions, 0 deletions
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;} +} |