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