Debian Codegraph @

framework/tests/all-systems/GenericCrazyBounds.java

raw
1 /*
2 * This class is solely to set up complicated recursive bounds in order to ensure that the
3 * bounds initializer creates bounds with the right structure
4 */
5
6 interface MyList<ZZ> {
7 ZZ getZZ();
8
9 void setZZ(ZZ ZZ);
10 }
11
12 interface MyMap<K, V> {
13 K getK();
14
15 V getV();
16
17 void setK(K k);
18
19 void setV(V v);
20 }
21
22 class MyRec<E extends MyList<E>> {}
23
24 class RecMyList extends MyRec<RecMyList> implements MyList<RecMyList> {
25 @SuppressWarnings("return.type.incompatible")
26 public RecMyList getZZ() {
27 return null;
28 }
29
30 public void setZZ(RecMyList rl) {
31 return;
32 }
33 }
34
35 class Context2 {
36
37 <T extends MyRec<? extends T> & MyList<T>> void main() {}
38
39 void context() {
40 this.<RecMyList>main();
41 }
42 }
43
44 interface Rec<T extends Rec<T>> {}
45
46 class MyRec2<E extends Rec<? extends E>> {}
47
48 class RecImpl implements Rec<RecImpl> {}
49
50 class SubRec extends RecImpl {}
51
52 class CrazyGen2<TT extends MyList<EE>, EE extends MyMap<TT, TT>> {
53 TT t2;
54 EE e2;
55
56 public CrazyGen2(TT t2, EE e2) {
57 this.t2 = t2;
58 this.e2 = e2;
59 }
60
61 public void context() {
62 t2.setZZ(e2);
63 e2.setK(t2.getZZ().getK());
64 }
65 }
66
67 class CrazyGen3<TTT extends MyList<TTT>, EEE extends MyMap<TTT, TTT>> {
68 TTT t3;
69 EEE e3;
70
71 public CrazyGen3(TTT t3, EEE e3) {
72 this.t3 = t3;
73 this.e3 = e3;
74 }
75
76 public void context() {
77 e3.setK(t3);
78 e3.setK(t3.getZZ());
79 }
80 }
81
82 class MyClass {
83
84 public <TV1 extends MyList<TV1>> String methodToPrint(TV1 tv1, int intParam) {
85 return "";
86 }
87 }