aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr110307/Case1.java
blob: b461e92022f5bf90e8d94df1ce2d05a7968ae1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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<X> AssociationSource<X>._target = null;

       public Link<Q> AssociationSource<Q>.getTarget() {
           return _target;
       }

       public void AssociationSource<Q>.setTarget(Link<Q> _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();
   }

}