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