NPEMethodReferenceAndGenericsTest.java revision 2677:211903a785f3
1139825Simp/*
21541Srgrimes * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
31541Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41541Srgrimes *
51541Srgrimes * This code is free software; you can redistribute it and/or modify it
61541Srgrimes * under the terms of the GNU General Public License version 2 only, as
71541Srgrimes * published by the Free Software Foundation.  Oracle designates this
81541Srgrimes * particular file as subject to the "Classpath" exception as provided
91541Srgrimes * by Oracle in the LICENSE file that accompanied this code.
101541Srgrimes *
111541Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT
121541Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131541Srgrimes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141541Srgrimes * version 2 for more details (a copy is included in the LICENSE file that
151541Srgrimes * accompanied this code).
161541Srgrimes *
171541Srgrimes * You should have received a copy of the GNU General Public License version
181541Srgrimes * 2 along with this work; if not, write to the Free Software Foundation,
191541Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201541Srgrimes *
211541Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221541Srgrimes * or visit www.oracle.com if you need additional information or have any
231541Srgrimes * questions.
241541Srgrimes */
251541Srgrimes
261541Srgrimes/**
271541Srgrimes * @test
281541Srgrimes * @bug 8057800
2914497Shsu * @summary Method reference with generic type creates NPE when compiling
3050477Speter * @compile NPEMethodReferenceAndGenericsTest.java
311541Srgrimes */
321541Srgrimes
332165Spaulpublic class NPEMethodReferenceAndGenericsTest {
3418020Sbde    public <T> void foo(java.util.Comparator<? super T> comparator) {}
352165Spaul
3655205Speter    public <C extends Comparable<? super C>> void foo() {
37103458Smike        foo(C::compareTo);
381541Srgrimes    }
391541Srgrimes}
40101038Sdes