T8148128.java revision 3224:4a4f58f3b344
175584Sru/*
275584Sru * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
375584Sru * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
475584Sru *
575584Sru * This code is free software; you can redistribute it and/or modify it
675584Sru * under the terms of the GNU General Public License version 2 only, as
775584Sru * published by the Free Software Foundation.  Oracle designates this
875584Sru * particular file as subject to the "Classpath" exception as provided
975584Sru * by Oracle in the LICENSE file that accompanied this code.
1075584Sru *
1175584Sru * This code is distributed in the hope that it will be useful, but WITHOUT
1275584Sru * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1375584Sru * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1475584Sru * version 2 for more details (a copy is included in the LICENSE file that
1575584Sru * accompanied this code).
1675584Sru *
1775584Sru * You should have received a copy of the GNU General Public License version
1875584Sru * 2 along with this work; if not, write to the Free Software Foundation,
19151497Sru * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2075584Sru *
2175584Sru * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2275584Sru * or visit www.oracle.com if you need additional information or have any
2375584Sru * questions.
2475584Sru */
2575584Sru
2675584Sru/*
2775584Sru * @test
2875584Sru * @bug 8148128
2975584Sru * @summary Regression: array constructor references marked as inexact
3075584Sru * @compile T8148128.java
3175584Sru */
3275584Sruimport java.util.*;
3375584Sruimport java.util.stream.*;
3475584Sru
3575584Sruclass T8148128 {
3675584Sru    public static void doSomething (List<String>[] stuff) {
3775584Sru        System.out.println("List Stuff");
3875584Sru    }
3975584Sru
4075584Sru    public static void doSomething (Set<String>[] stuff) {
4175584Sru        System.out.println("Set Stuff");
4275584Sru    }
4375584Sru
4475584Sru    public static void main (String[] args) {
4575584Sru        doSomething(Stream.of("Foo", "Bar").map(Collections::singletonList).toArray(List[]::new));
4675584Sru    }
4775584Sru}
4875584Sru