darcy@609: /* darcy@609: * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. darcy@609: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. darcy@609: * darcy@609: * This code is free software; you can redistribute it and/or modify it darcy@609: * under the terms of the GNU General Public License version 2 only, as darcy@609: * published by the Free Software Foundation. darcy@609: * darcy@609: * This code is distributed in the hope that it will be useful, but WITHOUT darcy@609: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or darcy@609: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License darcy@609: * version 2 for more details (a copy is included in the LICENSE file that darcy@609: * accompanied this code). darcy@609: * darcy@609: * You should have received a copy of the GNU General Public License version darcy@609: * 2 along with this work; if not, write to the Free Software Foundation, darcy@609: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. darcy@609: * darcy@609: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA darcy@609: * or visit www.oracle.com if you need additional information or have any darcy@609: * questions. darcy@609: */ darcy@609: darcy@609: /* darcy@609: * @test darcy@609: * @bug 6911256 6964740 6965277 darcy@609: * @author Maurizio Cimadamore darcy@609: * @summary Verify that method type-inference works as expected in TWR context darcy@609: * @compile TwrInference.java darcy@609: */ darcy@609: darcy@609: class TwrInference { darcy@609: darcy@609: public void test() { darcy@609: try(getX()) { darcy@609: //do something darcy@609: } catch (Exception e) { // Not reachable darcy@609: throw new AssertionError("Shouldn't reach here", e); darcy@609: } darcy@609: } darcy@609: darcy@609: X getX() { return null; } darcy@609: }