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