Thu, 21 Feb 2013 15:26:46 +0000
8007461: Regression: bad overload resolution when inner class and outer class have method with same name
Summary: Fix regression in varargs method resolution introduced by bad refactoring
Reviewed-by: jjg
1 /*
2 * Copyright (c) 2005, 2006, 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 */
24 /*
25 * @test
26 * @bug 6215213
27 * @summary Compiler JDK1.5 crashes with uses of generics
28 * @author Peter von der Ah\u00e9
29 * @compile T6215213.java
30 */
32 public class T6215213 {
33 static class Box<T> {}
34 static class Box1<T extends T6215213> {}
35 static class Pair<T, S> {}
36 static class Pair1<T extends T6215213, S> {}
37 static class Triple<T, S, U> {}
38 static class Triple1<T extends T6215213, S, U extends T6215213> {}
39 static class Quad<T, S, U, V> {}
40 static class Quad1<T extends T6215213, S, U extends T6215213, V> {}
42 <T> Box<T> testBox(T t) { return null; }
43 <T extends T6215213> Box1<T> testBox1(T t) { return null; }
44 <T> Pair<T, T> testPair(T t) { return null; }
45 <T extends T6215213> Pair1<T, T> testPair1(T t) { return null; }
46 <T> Triple<T, T, T> testTriple(T t) { return null; }
47 <T extends T6215213> Triple1<T, T, T> testTriple1(T t) { return null; }
48 <T> Quad<T, T, T, T> testQuad(T t) { return null; }
49 <T extends T6215213> Quad1<T, T, T, T> testQuad1(T t) { return null; }
51 void testAll() {
52 Box<?> box = testBox(null);
53 Box1<?> box1 = testBox1(null);
54 Pair<?, ?> pair = testPair(null);
55 Pair1<?, ?> pair1 = testPair1(null);
56 Triple<?, ?, ?> triple = testTriple(null);
57 Triple1<?, ?, ?> triple1 = testTriple1(null);
58 Quad<?, ?, ?, ?> quad = testQuad(null);
59 Quad1<?, ?, ?, ?> quad1 = testQuad1(null);
60 }
61 }