MemberClassTest.java revision 3792:d516975e8110
1/*
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24/*
25 * @test
26 * @bug 8006582 8008658
27 * @summary javac should generate method parameters correctly.
28 * @modules jdk.jdeps/com.sun.tools.classfile
29 * @build MethodParametersTester ClassFileVisitor ReflectionVisitor
30 * @compile -parameters MemberClassTest.java
31 * @run main MethodParametersTester MemberClassTest MemberClassTest.out
32 */
33
34class MemberClassTest {
35
36    interface I {
37        Long m();
38        Long m(Long x, Long yx);
39    }
40
41    public class Member implements I {
42        public class Member_Member {
43            public Member_Member() {}
44            public Member_Member(String x, String yx) {}
45        }
46
47        public Member()  { }
48        public Member(Long a, Long ba)  { }
49        public Long m() { return 0L; }
50        public Long m(Long s, Long ts) { return 0L; }
51    }
52
53    static class Static_Member implements I {
54        public class Static_Member_Member {
55            public Static_Member_Member() {}
56            public Static_Member_Member(String x, String yx) {}
57        }
58
59        public static class Static_Member_Static_Member {
60            public Static_Member_Static_Member() {}
61            public Static_Member_Static_Member(String x, String yx) {}
62        }
63        public Static_Member()  { }
64        public Static_Member(Long arg, Long barg)  { }
65        public Long m() { return 0L; }
66        public Long m(Long s, Long ts) { return s + ts; }
67    }
68
69    public MemberClassTest() {
70    }
71    public MemberClassTest(final Long a, Long ba) {
72    }
73
74    public void foo() {
75
76        new I() {
77
78            class Anonymous_Member {
79                public Anonymous_Member() {}
80                public Anonymous_Member(String x, String yx) {}
81            }
82
83            public Long m() { return 0L; }
84            public Long m(Long s, Long ts) { return s + ts; }
85        }.m();
86    }
87}
88