langtools/test/tools/javac/BreakAcrossClass.java
author lana
Tue, 25 Apr 2017 07:38:50 +0000
changeset 44909 b53c770dc04f
parent 26274 02a5b23ee21c
permissions -rw-r--r--
Added tag jdk-10+1 for changeset 3a409afd3f86

/*
 * @test /nodynamiccopyright/
 * @bug 4407643
 * @summary javac throws NullPointerException for break to label outside of class
 * @author gafter
 *
 * @compile/fail/ref=BreakAcrossClass.out -XDrawDiagnostics  BreakAcrossClass.java
 */

class BreakAcrossClass {
     public static void main(String argv[]) {
        final int i = 6;
    M:  {
            class A {
                {
                    if (i != 5) break M;
                }
            }
            System.out.println("failed : " + i);
        }
        System.out.println("passed : " + i);
    }
}