Mon, 17 Oct 2011 12:57:36 +0100
7093325: Redundant entry in bytecode exception table
Summary: Inlining of finalizers does not update gaps list accordingly
Reviewed-by: jjg
mcimadamore@742 | 1 | /* |
ohair@962 | 2 | * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. |
mcimadamore@742 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
mcimadamore@742 | 4 | * |
mcimadamore@742 | 5 | * This code is free software; you can redistribute it and/or modify it |
mcimadamore@742 | 6 | * under the terms of the GNU General Public License version 2 only, as |
mcimadamore@742 | 7 | * published by the Free Software Foundation. |
mcimadamore@742 | 8 | * |
mcimadamore@742 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
mcimadamore@742 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mcimadamore@742 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
mcimadamore@742 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
mcimadamore@742 | 13 | * accompanied this code). |
mcimadamore@742 | 14 | * |
mcimadamore@742 | 15 | * You should have received a copy of the GNU General Public License version |
mcimadamore@742 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
mcimadamore@742 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
mcimadamore@742 | 18 | * |
mcimadamore@742 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
mcimadamore@742 | 20 | * or visit www.oracle.com if you need additional information or have any |
mcimadamore@742 | 21 | * questions. |
mcimadamore@742 | 22 | */ |
mcimadamore@742 | 23 | |
mcimadamore@742 | 24 | /* |
mcimadamore@742 | 25 | * @test |
mcimadamore@810 | 26 | * @bug 6999067 7010194 |
mcimadamore@742 | 27 | * @summary cast for invokeExact call gets redundant cast to <type> warnings |
mcimadamore@742 | 28 | * @author mcimadamore |
mcimadamore@742 | 29 | * |
mcimadamore@742 | 30 | * @compile -Werror -Xlint:cast XlintWarn.java |
mcimadamore@742 | 31 | */ |
mcimadamore@742 | 32 | |
ksrini@957 | 33 | import java.lang.invoke.*; |
mcimadamore@742 | 34 | |
mcimadamore@742 | 35 | class XlintWarn { |
mcimadamore@742 | 36 | void test(MethodHandle mh) throws Throwable { |
mcimadamore@810 | 37 | int i1 = (int)mh.invokeExact(); |
jjh@1021 | 38 | int i2 = (int)mh.invoke(); |
mcimadamore@820 | 39 | int i3 = (int)mh.invokeWithArguments(); |
mcimadamore@820 | 40 | } |
mcimadamore@820 | 41 | |
mcimadamore@820 | 42 | void test2(MethodHandle mh) throws Throwable { |
mcimadamore@820 | 43 | int i1 = (int)(mh.invokeExact()); |
jjh@1021 | 44 | int i2 = (int)(mh.invoke()); |
mcimadamore@820 | 45 | int i3 = (int)(mh.invokeWithArguments()); |
mcimadamore@820 | 46 | } |
mcimadamore@820 | 47 | |
mcimadamore@820 | 48 | void test3(MethodHandle mh) throws Throwable { |
mcimadamore@820 | 49 | int i1 = (int)((mh.invokeExact())); |
jjh@1021 | 50 | int i2 = (int)((mh.invoke())); |
mcimadamore@820 | 51 | int i3 = (int)((mh.invokeWithArguments())); |
mcimadamore@742 | 52 | } |
mcimadamore@742 | 53 | } |