test/tools/javac/lambda/methodReferenceExecution/MethodReferenceIntersection3.java

Thu, 26 Mar 2015 11:34:50 +0100

author
jlahoda
date
Thu, 26 Mar 2015 11:34:50 +0100
changeset 2734
ba758e1ffa69
parent 2614
b5c8adb2206a
permissions
-rw-r--r--

8054220: Debugger doesn't show variables *outside* lambda
8058227: Debugger has no access to outer variables inside Lambda
Summary: Put local variables captured by lambda into the lambda method's LocalVariableTable.
Reviewed-by: mcimadamore, rfield

rfield@2614 1 /*
rfield@2614 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
rfield@2614 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
rfield@2614 4 *
rfield@2614 5 * This code is free software; you can redistribute it and/or modify it
rfield@2614 6 * under the terms of the GNU General Public License version 2 only, as
rfield@2614 7 * published by the Free Software Foundation. Oracle designates this
rfield@2614 8 * particular file as subject to the "Classpath" exception as provided
rfield@2614 9 * by Oracle in the LICENSE file that accompanied this code.
rfield@2614 10 *
rfield@2614 11 * This code is distributed in the hope that it will be useful, but WITHOUT
rfield@2614 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rfield@2614 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
rfield@2614 14 * version 2 for more details (a copy is included in the LICENSE file that
rfield@2614 15 * accompanied this code).
rfield@2614 16 *
rfield@2614 17 * You should have received a copy of the GNU General Public License version
rfield@2614 18 * 2 along with this work; if not, write to the Free Software Foundation,
rfield@2614 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rfield@2614 20 *
rfield@2614 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
rfield@2614 22 * or visit www.oracle.com if you need additional information or have any
rfield@2614 23 * questions.
rfield@2614 24 */
rfield@2614 25
rfield@2614 26 /**
rfield@2614 27 * @test
rfield@2614 28 * @bug 8058112
rfield@2614 29 * @summary Invalid BootstrapMethod for constructor/method reference
rfield@2614 30 */
rfield@2614 31
rfield@2614 32 /**
rfield@2614 33 * @author Remi Forax
rfield@2614 34 */
rfield@2614 35
rfield@2614 36 public class MethodReferenceIntersection3 {
rfield@2614 37 interface A {}
rfield@2614 38
rfield@2614 39 interface Foo {
rfield@2614 40 <T extends Object & A> void foo(T t);
rfield@2614 41 }
rfield@2614 42
rfield@2614 43 static <T extends A> void bar(T t) {
rfield@2614 44 }
rfield@2614 45
rfield@2614 46 public static void main(String[] args) {
rfield@2614 47 Foo foo = MethodReferenceIntersection3::bar;
rfield@2614 48 foo.foo(new A(){});
rfield@2614 49 }
rfield@2614 50 }

mercurial