1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/resolve/tests/AbstractMerge.java Mon Jul 01 14:57:03 2013 +0100 1.3 @@ -0,0 +1,107 @@ 1.4 +/* 1.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + */ 1.26 +@TraceResolve 1.27 +class AbstractMerge { 1.28 + 1.29 + interface A { 1.30 + @Candidate(applicable=Phase.BASIC) 1.31 + java.io.Serializable m1(); 1.32 + @Candidate(applicable=Phase.BASIC) 1.33 + java.io.Serializable m2(); 1.34 + @Candidate(applicable=Phase.BASIC) 1.35 + java.io.Serializable m3(); 1.36 + @Candidate(applicable=Phase.BASIC) 1.37 + java.io.Serializable m4(); 1.38 + @Candidate(applicable=Phase.BASIC) 1.39 + java.io.Serializable m5(); 1.40 + @Candidate(applicable=Phase.BASIC) 1.41 + java.io.Serializable m6(); 1.42 + } 1.43 + 1.44 + interface B { 1.45 + @Candidate(applicable=Phase.BASIC) 1.46 + Cloneable m1(); 1.47 + @Candidate(applicable=Phase.BASIC) 1.48 + Cloneable m2(); 1.49 + @Candidate(applicable=Phase.BASIC) 1.50 + Cloneable m3(); 1.51 + @Candidate(applicable=Phase.BASIC) 1.52 + Cloneable m4(); 1.53 + @Candidate(applicable=Phase.BASIC) 1.54 + Cloneable m5(); 1.55 + @Candidate(applicable=Phase.BASIC) 1.56 + Cloneable m6(); 1.57 + } 1.58 + 1.59 + interface C { 1.60 + @Candidate(applicable=Phase.BASIC, mostSpecific=true) 1.61 + Object[] m1(); 1.62 + @Candidate(applicable=Phase.BASIC, mostSpecific=true) 1.63 + Object[] m2(); 1.64 + @Candidate(applicable=Phase.BASIC, mostSpecific=true) 1.65 + Object[] m3(); 1.66 + @Candidate(applicable=Phase.BASIC, mostSpecific=true) 1.67 + Object[] m4(); 1.68 + @Candidate(applicable=Phase.BASIC, mostSpecific=true) 1.69 + Object[] m5(); 1.70 + @Candidate(applicable=Phase.BASIC, mostSpecific=true) 1.71 + Object[] m6(); 1.72 + } 1.73 + 1.74 + interface ABC extends A, B, C { } 1.75 + interface ACB extends A, C, B { } 1.76 + interface BAC extends B, A, C { } 1.77 + interface BCA extends B, C, A { } 1.78 + interface CAB extends C, A, B { } 1.79 + interface CBA extends C, B, A { } 1.80 + 1.81 + { 1.82 + ABC abc = null; 1.83 + abc.m1(); 1.84 + } 1.85 + 1.86 + { 1.87 + ACB acb = null; 1.88 + acb.m2(); 1.89 + } 1.90 + 1.91 + { 1.92 + BAC bac = null; 1.93 + bac.m3(); 1.94 + } 1.95 + 1.96 + { 1.97 + BCA bca = null; 1.98 + bca.m4(); 1.99 + } 1.100 + 1.101 + { 1.102 + CAB cab = null; 1.103 + cab.m5(); 1.104 + } 1.105 + 1.106 + { 1.107 + CBA cba = null; 1.108 + cba.m6(); 1.109 + } 1.110 +}