test/langtools/tools/javac/generics/inference/8178427/T8178427.java
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 52377 907fdbbdf584
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47952
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     1
/*
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     4
 *
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
52377
907fdbbdf584 8213263: fix legal headers in test/langtools
jjg
parents: 47952
diff changeset
     7
 * published by the Free Software Foundation.
47952
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     8
 *
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    14
 *
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    18
 *
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    21
 * questions.
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    22
 */
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    23
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    24
/*
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    25
 * @test
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    26
 * @bug 8178427
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    27
 * @summary NPE in Infer$CheckUpperBounds
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    28
 * @compile T8178427.java
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    29
 */
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    30
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    31
import java.util.Map;
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    32
import java.util.concurrent.ExecutorService;
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    33
import java.util.function.*;
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    34
import java.util.stream.*;
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    35
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    36
abstract class X {
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    37
    public interface N<K, V> {
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    38
        Stream<V> getValues();
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    39
    }
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    40
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    41
    abstract <K, V> N<K, V> c();
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    42
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    43
    abstract <T, K, V, M extends N<K, V>> Collector<T, ?, M> f(
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    44
            Function<? super T, ? extends K> k,
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    45
            Function<? super T, ? extends Stream<? extends V>> v,
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    46
            Supplier<M> multimapSupplier);
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    47
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    48
    void m(Map<String, N<?, ?>> c, ExecutorService s) {
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    49
        s.submit(() -> {
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    50
            return c.entrySet().parallelStream()
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    51
                    .collect(f(Map.Entry::getKey, e -> e.getValue().getValues(), this::c));
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    52
        });
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    53
    }
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    54
}
469e42d314a4 8178427: NPE in Infer$CheckUpperBounds
mcimadamore
parents:
diff changeset
    55