lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
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
import java.util.List;
 
class MethodCalls {
 
    public int member;
    
    public MethodCalls getSelf()
    {
        return this;
    }
 
 
    public void foo()
    {
    }
 
    void bar1()
    {
        getSelf().getSelf().foo();
    }
 
    int bar2()
    {
        return getSelf().m;
    }
 
    void inheritedInterfaceMethod(){
        List<Integer> list;
        list.toString();
    }
 
    void variadicTest(){
        String[] varArg = new String[2];
        foobar("a");
        foobar(varArg);
    }
 
    int foobar(String s){
        return 1;
    }
 
    void foobar(String... s){
        return;
    }
 
    void variadicMethod(String... s)
    {
        this.variadicMethod("test");
    }
 
    <T> T genericMethod0() { return null; }
    <T> T genericMethod1(T x) { return x; }
 
    static <T> T staticGenericMethod0() { return null; }
    static <T> T staticGenericMethod1(T x) { return x; }
 
    static class GenericClass<T> {}
 
    static void variadicWithGenericArg(int i, GenericClass<?>... c) {}
 
    void genericMethodTest() {
        this.<Integer>genericMethod0();
        this.genericMethod1("Hello");
 
        MethodCalls.<Integer>staticGenericMethod0();
        MethodCalls.staticGenericMethod1("Hello");
 
        MethodCalls.variadicWithGenericArg(1, new GenericClass<Long>());
    }
}