aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/itds/sharing/Simple.aj
blob: 0c328ed3460339f1a3771149f17d8bff06398016 (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
public class Simple {
  public static void main(String []argv) {
    Base<Integer> base = new Base<Integer>();
    List<Integer> intList = new ArrayList<Integer>();
    intList.add(5);
    intList.add(2);
    intList.add(3);
    intList.add(8);
    System.err.println(">"+base.m(intList));
    System.err.println(">"+base.m2(intList));
  }
}



class Base<N extends Number> {

   public int m(List<N> ns) {
     return ns.size();
   }

}

aspect X {

  public int Base<Z>.m2(List<Z> zs) {
     return zs.size();
  }
}