Skip to content

Commit 3d44c88

Browse files
authored
chore: Add MethodHandleFacade calls to arity 22 (#68)
1 parent 5481501 commit 3d44c88

File tree

1 file changed

+101
-27
lines changed

1 file changed

+101
-27
lines changed

core/src/fr/hammons/slinc/MethodHandleFacade.java

Lines changed: 101 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,125 @@
33
import java.lang.invoke.MethodHandle;
44

55
public class MethodHandleFacade {
6-
public static Object call0(MethodHandle mh) throws Throwable {
7-
return mh.invoke();
8-
}
6+
public static Object call0(MethodHandle mh) throws Throwable {
7+
return mh.invoke();
8+
}
99

10-
public static Object call1(MethodHandle mh, Object a) throws Throwable {
11-
return mh.invoke(a);
12-
}
10+
public static Object call1(MethodHandle mh, Object a) throws Throwable {
11+
return mh.invoke(a);
12+
}
13+
14+
public static int call1Int(MethodHandle mh, int a) throws Throwable {
15+
return (int) mh.invoke(a);
16+
}
17+
18+
public static Object call2Int(MethodHandle mh, Object sa, int a, int b) throws Throwable {
19+
return mh.invoke(sa, a, b);
20+
}
21+
22+
public static int callExact(MethodHandle mh, int a) throws Throwable {
23+
return (int) mh.invokeExact(a);
24+
}
25+
26+
public static Object call2(MethodHandle mh, Object a, Object b) throws Throwable {
27+
return mh.invoke(a, b);
28+
}
29+
30+
public static Object call3(MethodHandle mh, Object a, Object b, Object c) throws Throwable {
31+
return mh.invoke(a, b, c);
32+
}
33+
34+
public static Object call4(MethodHandle mh, Object a, Object b, Object c, Object d) throws Throwable {
35+
return mh.invoke(a, b, c, d);
36+
}
37+
38+
public static Object call5(MethodHandle mh, Object a, Object b, Object c, Object d, Object e) throws Throwable {
39+
return mh.invoke(a, b, c, d, e);
40+
}
1341

14-
public static int call1Int(MethodHandle mh, int a) throws Throwable {
15-
return (int) mh.invoke(a);
42+
public static Object call6(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f)
43+
throws Throwable {
44+
return mh.invoke(a, b, c, d, e, f);
45+
}
46+
47+
public static Object call7(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g)
48+
throws Throwable {
49+
return mh.invoke(a, b, c, d, e, f, g);
50+
}
51+
52+
public static Object call8(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g,
53+
Object h) throws Throwable {
54+
return mh.invoke(a, b, c, d, e, f, g, h);
55+
}
56+
57+
public static Object call9(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g,
58+
Object h, Object i) throws Throwable {
59+
return mh.invoke(a, b, c, d, e, f, g, h, i);
60+
}
61+
62+
public static Object call10(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g,
63+
Object h, Object i, Object j) throws Throwable {
64+
return mh.invoke(a, b, c, d, e, f, g, h, i, j);
65+
}
66+
67+
public static Object call11(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g,
68+
Object h, Object i, Object j, Object k) throws Throwable {
69+
return mh.invoke(a, b, c, d, e, f, g, h, i, j, k);
70+
}
71+
72+
public static Object call12(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g,
73+
Object h, Object i, Object j, Object k, Object l) throws Throwable {
74+
return mh.invoke(a, b, c, d, e, f, g, h, i, j, k, l);
75+
}
76+
77+
public static Object call13(MethodHandle mh, Object a, Object b, Object c,
78+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m) throws Throwable {
79+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l);
1680
}
1781

18-
public static Object call2Int(MethodHandle mh, Object sa, int a, int b) throws Throwable {
19-
return mh.invoke(sa,a,b);
82+
public static Object call14(MethodHandle mh, Object a, Object b, Object c,
83+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n) throws Throwable {
84+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n);
2085
}
2186

22-
public static int callExact(MethodHandle mh, int a) throws Throwable {
23-
return (int) mh.invokeExact(a);
87+
public static Object call15(MethodHandle mh, Object a, Object b, Object c,
88+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o) throws Throwable {
89+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o);
2490
}
2591

26-
public static Object call2(MethodHandle mh, Object a, Object b) throws Throwable {
27-
return mh.invoke(a,b);
92+
public static Object call16(MethodHandle mh, Object a, Object b, Object c,
93+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p) throws Throwable {
94+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
2895
}
2996

30-
public static Object call3(MethodHandle mh, Object a, Object b, Object c) throws Throwable {
31-
return mh.invoke(a,b,c);
97+
public static Object call17(MethodHandle mh, Object a, Object b, Object c,
98+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p, Object q) throws Throwable {
99+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q);
32100
}
33101

34-
public static Object call4(MethodHandle mh, Object a, Object b, Object c, Object d) throws Throwable {
35-
return mh.invoke(a,b,c,d);
102+
public static Object call18(MethodHandle mh, Object a, Object b, Object c,
103+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p, Object q, Object r) throws Throwable {
104+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r);
36105
}
37106

38-
public static Object call5(MethodHandle mh, Object a, Object b, Object c, Object d, Object e) throws Throwable {
39-
return mh.invoke(a,b,c,d,e);
107+
public static Object call19(MethodHandle mh, Object a, Object b, Object c,
108+
Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p, Object q, Object r, Object s) throws Throwable {
109+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s);
40110
}
41111

42-
public static Object call6(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f) throws Throwable {
43-
return mh.invoke(a,b,c,d,e,f);
112+
public static Object call20(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p, Object q, Object r, Object s, Object t) throws Throwable {
113+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t);
44114
}
45-
46-
public static Object call7(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g) throws Throwable {
47-
return mh.invoke(a,b,c,d,e,f,g);
115+
116+
public static Object call21(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p, Object q, Object r, Object s, Object t, Object u) throws Throwable {
117+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u);
48118
}
49119

50-
public static Object callVariadic(MethodHandle mh, Object... a) throws Throwable {
51-
return mh.invokeWithArguments(a);
120+
public static Object call22(MethodHandle mh, Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k, Object l, Object m, Object n, Object o, Object p, Object q, Object r, Object s, Object t, Object u, Object v) throws Throwable {
121+
return mh.invoke(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v);
52122
}
123+
124+
public static Object callVariadic(MethodHandle mh, Object... a) throws Throwable {
125+
return mh.invokeWithArguments(a);
126+
}
53127
}

0 commit comments

Comments
 (0)