aboutsummaryrefslogtreecommitdiffstats
path: root/javaparser-symbol-solver-testing/src/test/resources/AnonymousClassDeclarations.java.txt
blob: f994225bc59e15540cfe8d166df80405b5f7ba81 (plain)
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
class AnonymousClassDeclarations {

    static class DoFn<I,O> {
        static class ProcessContext {
            public Long innerClassMethod() {}
        }

        enum MyEnum {
            E1, E2, E3
        }

        public void process(ProcessContext context) {}
    }

    static class Transform<I,O> {}

    static class ParDo {
        static <I,O> Transform<I,O> of(DoFn<I,O> doFn) {
            return null;
        }
    }

    void fooBar1() {
        ParDo.of(new DoFn<Integer,Long>() {});
    }

    void fooBar2() {
        ParDo.of(new DoFn<Integer,Long>() {
            public void process(ProcessContext c){
                return c.innerClassMethod();
            }
        });
    }

    void fooBar3() {
        ParDo.of(new DoFn<Integer,Long>() {

            void callAnnonClassInnerMethod() {}

            public void process(ProcessContext c) {
                callAnnonClassInnerMethod();
            }
        });
    }

     void fooBar4() {
        ParDo.of(new DoFn<Integer,Long>() {

            void callAnnonClassInnerMethod() {}

            public void process(ProcessContext c) {
                MyEnum.E3.toString();
            }
        });
    }

    void fooBar5() {
        ParDo.of(new DoFn<Integer,Long>() {

            void callAnnonClassInnerMethod() {}

            enum MyInnerEnum {
                E1, E2, E3
            }
            public void process(ProcessContext c) {
                MyInnerEnum.E3.toString();
            }
        });
    }

}