2931N/A/*
2931N/A * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
2931N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2931N/A *
2931N/A * This code is free software; you can redistribute it and/or modify it
2931N/A * under the terms of the GNU General Public License version 2 only, as
2931N/A * published by the Free Software Foundation.
2931N/A *
2931N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2931N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2931N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2931N/A * version 2 for more details (a copy is included in the LICENSE file that
2931N/A * accompanied this code).
2931N/A *
2931N/A * You should have received a copy of the GNU General Public License version
2931N/A * 2 along with this work; if not, write to the Free Software Foundation,
2931N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2931N/A *
2931N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2931N/A * or visit www.oracle.com if you need additional information or have any
2931N/A * questions.
2931N/A */
2931N/A
2931N/A/*
2931N/A * @test
2931N/A * @bug 5009693
2931N/A * @summary relaxed rules for array of generic type and varargs.
2931N/A * @author gafter
2931N/A *
2931N/A * @compile RelaxedArrays.java
2931N/A * @run main RelaxedArrays
2931N/A */
2931N/A
2931N/Aimport java.util.ArrayList;
2931N/Aimport java.util.List;
2931N/A
2931N/Apublic class RelaxedArrays {
2931N/A static class StringList extends ArrayList<String> {
2931N/A }
2931N/A
2931N/A static <T> T select(T... tl) {
2931N/A return tl.length == 0 ? null : tl[tl.length - 1];
2931N/A }
2931N/A
2931N/A public static void main(String[] args) {
2931N/A List<String>[] a = new StringList[20];
2931N/A if (select("A", "B", "C") != "C") throw new Error();
2931N/A }
2931N/A}
2931N/A