rfield@1405: /* rfield@1405: * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. rfield@1405: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. rfield@1405: * rfield@1405: * This code is free software; you can redistribute it and/or modify it rfield@1405: * under the terms of the GNU General Public License version 2 only, as rfield@1405: * published by the Free Software Foundation. rfield@1405: * rfield@1405: * This code is distributed in the hope that it will be useful, but WITHOUT rfield@1405: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or rfield@1405: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License rfield@1405: * version 2 for more details (a copy is included in the LICENSE file that rfield@1405: * accompanied this code). rfield@1405: * rfield@1405: * You should have received a copy of the GNU General Public License version rfield@1405: * 2 along with this work; if not, write to the Free Software Foundation, rfield@1405: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. rfield@1405: * rfield@1405: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA rfield@1405: * or visit www.oracle.com if you need additional information or have any rfield@1405: * questions. rfield@1405: */ rfield@1405: rfield@1405: /* rfield@1405: * @test mcimadamore@1415: * @bug 8003280 mcimadamore@1415: * @summary Add lambda tests mcimadamore@1415: * Regression test JDK-8003306 inner class constructor in lambda rfield@1405: * @author Robert Field rfield@1405: */ rfield@1405: mcimadamore@1415: public class InnerConstructor { rfield@1405: mcimadamore@1415: public static void main(String... args) { mcimadamore@1415: InnerConstructor ic = new InnerConstructor(); mcimadamore@1415: String res = ic.seq1().m().toString(); mcimadamore@1415: if (!res.equals("Cbl.toString")) { mcimadamore@1415: throw new AssertionError(String.format("Unexpected result: %s", res)); mcimadamore@1415: } rfield@1405: } rfield@1405: rfield@1405: Ib1 seq1() { rfield@1405: return () -> new Cbl(); rfield@1405: } rfield@1405: rfield@1405: class Cbl { rfield@1405: Cbl() { } mcimadamore@1415: public String toString() { mcimadamore@1415: return "Cbl.toString"; mcimadamore@1415: } rfield@1405: } rfield@1405: rfield@1405: interface Ib1 { rfield@1405: Object m(); rfield@1405: } rfield@1405: }