Fri, 12 Nov 2010 12:34:18 +0000
6970016: Clean up ARM/try-with-resources implementation
Summary: changed Xlint option name from -Xlint:arm to -Xlint:try
Reviewed-by: jjg
darcy@609 | 1 | /* |
darcy@609 | 2 | * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
darcy@609 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
darcy@609 | 4 | * |
darcy@609 | 5 | * This code is free software; you can redistribute it and/or modify it |
darcy@609 | 6 | * under the terms of the GNU General Public License version 2 only, as |
darcy@609 | 7 | * published by the Free Software Foundation. |
darcy@609 | 8 | * |
darcy@609 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
darcy@609 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
darcy@609 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
darcy@609 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
darcy@609 | 13 | * accompanied this code). |
darcy@609 | 14 | * |
darcy@609 | 15 | * You should have received a copy of the GNU General Public License version |
darcy@609 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
darcy@609 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
darcy@609 | 18 | * |
darcy@609 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
darcy@609 | 20 | * or visit www.oracle.com if you need additional information or have any |
darcy@609 | 21 | * questions. |
darcy@609 | 22 | */ |
darcy@609 | 23 | |
darcy@609 | 24 | /* |
darcy@609 | 25 | * @test |
darcy@609 | 26 | * @bug 6911256 6964740 6965277 |
darcy@609 | 27 | * @author Maurizio Cimadamore |
darcy@609 | 28 | * @summary Resource of an intersection type crashes Flow |
darcy@609 | 29 | * @compile TwrIntersection.java |
darcy@609 | 30 | */ |
darcy@609 | 31 | |
darcy@609 | 32 | interface MyCloseable extends AutoCloseable { |
darcy@609 | 33 | void close() throws java.io.IOException; |
darcy@609 | 34 | } |
darcy@609 | 35 | |
darcy@609 | 36 | class ResourceTypeVar { |
darcy@609 | 37 | |
darcy@609 | 38 | public void test() { |
darcy@609 | 39 | try(getX()) { |
darcy@609 | 40 | //do something |
darcy@609 | 41 | } catch (java.io.IOException e) { // Not reachable |
darcy@609 | 42 | throw new AssertionError("Shouldn't reach here", e); |
darcy@609 | 43 | } |
darcy@609 | 44 | } |
darcy@609 | 45 | |
darcy@609 | 46 | <X extends Number & MyCloseable> X getX() { return null; } |
darcy@609 | 47 | } |