test/tools/javac/resolve/tests/AbstractMerge.java

changeset 1875
f559ef7568ce
parent 0
959103a6100f
equal deleted inserted replaced
1874:891c5ecb8306 1875:f559ef7568ce
1 /*
2 * Copyright (c) 2013, 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 @TraceResolve
24 class AbstractMerge {
25
26 interface A {
27 @Candidate(applicable=Phase.BASIC)
28 java.io.Serializable m1();
29 @Candidate(applicable=Phase.BASIC)
30 java.io.Serializable m2();
31 @Candidate(applicable=Phase.BASIC)
32 java.io.Serializable m3();
33 @Candidate(applicable=Phase.BASIC)
34 java.io.Serializable m4();
35 @Candidate(applicable=Phase.BASIC)
36 java.io.Serializable m5();
37 @Candidate(applicable=Phase.BASIC)
38 java.io.Serializable m6();
39 }
40
41 interface B {
42 @Candidate(applicable=Phase.BASIC)
43 Cloneable m1();
44 @Candidate(applicable=Phase.BASIC)
45 Cloneable m2();
46 @Candidate(applicable=Phase.BASIC)
47 Cloneable m3();
48 @Candidate(applicable=Phase.BASIC)
49 Cloneable m4();
50 @Candidate(applicable=Phase.BASIC)
51 Cloneable m5();
52 @Candidate(applicable=Phase.BASIC)
53 Cloneable m6();
54 }
55
56 interface C {
57 @Candidate(applicable=Phase.BASIC, mostSpecific=true)
58 Object[] m1();
59 @Candidate(applicable=Phase.BASIC, mostSpecific=true)
60 Object[] m2();
61 @Candidate(applicable=Phase.BASIC, mostSpecific=true)
62 Object[] m3();
63 @Candidate(applicable=Phase.BASIC, mostSpecific=true)
64 Object[] m4();
65 @Candidate(applicable=Phase.BASIC, mostSpecific=true)
66 Object[] m5();
67 @Candidate(applicable=Phase.BASIC, mostSpecific=true)
68 Object[] m6();
69 }
70
71 interface ABC extends A, B, C { }
72 interface ACB extends A, C, B { }
73 interface BAC extends B, A, C { }
74 interface BCA extends B, C, A { }
75 interface CAB extends C, A, B { }
76 interface CBA extends C, B, A { }
77
78 {
79 ABC abc = null;
80 abc.m1();
81 }
82
83 {
84 ACB acb = null;
85 acb.m2();
86 }
87
88 {
89 BAC bac = null;
90 bac.m3();
91 }
92
93 {
94 BCA bca = null;
95 bca.m4();
96 }
97
98 {
99 CAB cab = null;
100 cab.m5();
101 }
102
103 {
104 CBA cba = null;
105 cba.m6();
106 }
107 }

mercurial