File: UsesSingleMethodInterface.java

package info (click to toggle)
jruby 1.5.1-1%2Bdeb6u1
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze-lts
  • size: 47,024 kB
  • ctags: 74,144
  • sloc: ruby: 398,155; java: 169,506; yacc: 3,782; xml: 2,469; ansic: 415; sh: 279; makefile: 78; tcl: 40
file content (81 lines) | stat: -rw-r--r-- 2,788 bytes parent folder | download | duplicates (5)
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();
    }
}