mcimadamore@3852: /* mcimadamore@3852: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. mcimadamore@3852: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@3852: * mcimadamore@3852: * This code is free software; you can redistribute it and/or modify it mcimadamore@3852: * under the terms of the GNU General Public License version 2 only, as mcimadamore@3852: * published by the Free Software Foundation. mcimadamore@3852: * mcimadamore@3852: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@3852: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@3852: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@3852: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@3852: * accompanied this code). mcimadamore@3852: * mcimadamore@3852: * You should have received a copy of the GNU General Public License version mcimadamore@3852: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@3852: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@3852: * mcimadamore@3852: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA mcimadamore@3852: * or visit www.oracle.com if you need additional information or have any mcimadamore@3852: * questions. mcimadamore@3852: */ mcimadamore@3852: mcimadamore@3852: /* mcimadamore@3852: * @test mcimadamore@3852: * @bug 8067429 mcimadamore@3852: * @summary java.lang.VerifyError: Inconsistent stackmap frames at branch target mcimadamore@3852: * @author srikanth mcimadamore@3852: * mcimadamore@3852: * @compile BranchToFewerDefines.java mcimadamore@3852: * @run main BranchToFewerDefines mcimadamore@3852: */ mcimadamore@3852: mcimadamore@3852: public class BranchToFewerDefines { mcimadamore@3852: public static void main(String[] args) { mcimadamore@3852: } mcimadamore@3852: private void problematicMethod(int p) { mcimadamore@3852: switch (p) { mcimadamore@3852: case 3: mcimadamore@3852: long n; mcimadamore@3852: while (true) { mcimadamore@3852: if (false) { mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: break; mcimadamore@3852: case 2: mcimadamore@3852: loop: while (true) { mcimadamore@3852: while (true) { mcimadamore@3852: int i = 4; mcimadamore@3852: if (p != 16) { mcimadamore@3852: return; mcimadamore@3852: } mcimadamore@3852: break loop; mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: break; mcimadamore@3852: default: mcimadamore@3852: while (true) { mcimadamore@3852: if (false) { mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: long b; mcimadamore@3852: if (p != 7) { mcimadamore@3852: switch (p) { mcimadamore@3852: case 1: mcimadamore@3852: long a = 17; mcimadamore@3852: break; mcimadamore@3852: case 2: mcimadamore@3852: break; mcimadamore@3852: default: mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: private void problematicMethod2(int p) { mcimadamore@3852: switch (p) { mcimadamore@3852: case 3: mcimadamore@3852: long n; mcimadamore@3852: { mcimadamore@3852: int i = 4; mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: case 2: mcimadamore@3852: { mcimadamore@3852: int i = 4; mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: default: mcimadamore@3852: { mcimadamore@3852: int i = 4; mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: long b; mcimadamore@3852: if (p != 7) { mcimadamore@3852: switch (p) { mcimadamore@3852: case 1: mcimadamore@3852: long a = 17; mcimadamore@3852: break; mcimadamore@3852: case 2: mcimadamore@3852: break; mcimadamore@3852: default: mcimadamore@3852: break; mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: } mcimadamore@3852: }