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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
package java_integration.fixtures;
import java.util.concurrent.Callable;
public class UsesSingleMethodInterface {
public Object result;
public UsesSingleMethodInterface() {
}
// coercion during constructor call
public UsesSingleMethodInterface(SingleMethodInterface obj) {
result = obj.callIt();
}
public UsesSingleMethodInterface(Object a, SingleMethodInterface obj) {
result = obj.callIt();
}
public UsesSingleMethodInterface(Object a, Object b, SingleMethodInterface obj) {
result = obj.callIt();
}
public UsesSingleMethodInterface(Object a, Object b, Object c, SingleMethodInterface obj) {
result = obj.callIt();
}
// 3 normal args is our cutoff for specific-arity optz, so test four
public UsesSingleMethodInterface(Object a, Object b, Object c, Object d, SingleMethodInterface obj) {
result = obj.callIt();
}
// coercion during static call
public static Object callIt(SingleMethodInterface obj) {
return obj.callIt();
}
public static Object callIt(Object a, SingleMethodInterface obj) {
return obj.callIt();
}
public static Object callIt(Object a, Object b, SingleMethodInterface obj) {
return obj.callIt();
}
public static Object callIt(Object a, Object b, Object c, SingleMethodInterface obj) {
return obj.callIt();
}
// 3 normal args is our cutoff for specific-arity optz, so test four
public static Object callIt(Object a, Object b, Object c, Object d, SingleMethodInterface obj) {
return obj.callIt();
}
public static Object castAndCallIt(Object obj) {
return callIt((SingleMethodInterface) obj);
}
// coercion during instance call
public Object callIt2(SingleMethodInterface obj) {
return obj.callIt();
}
public Object callIt2(Object a, SingleMethodInterface obj) {
return obj.callIt();
}
public Object callIt2(Object a, Object b, SingleMethodInterface obj) {
return obj.callIt();
}
public Object callIt2(Object a, Object b, Object c, SingleMethodInterface obj) {
return obj.callIt();
}
// 3 normal args is our cutoff for specific-arity optz, so test four
public Object callIt2(Object a, Object b, Object c, Object d, SingleMethodInterface obj) {
return obj.callIt();
}
public SingleMethodInterface callIt3(Callable callable) throws Exception {
return (SingleMethodInterface) callable.call();
}
public static int hashCode(Object obj) {
return obj.hashCode();
}
public static String toString(Object obj) {
return obj.toString();
}
public static Class getClass(Object obj) {
return obj.getClass();
}
}
|