2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-08-29 07:42:42 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 4407643
|
|
|
|
* @summary javac throws NullPointerException for break to label outside of class
|
|
|
|
* @author gafter
|
|
|
|
*
|
2014-08-29 07:42:42 +00:00
|
|
|
* @compile/fail/ref=BreakAcrossClass.out -XDrawDiagnostics BreakAcrossClass.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
class BreakAcrossClass {
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2007-12-01 00:00:00 +00:00
|
|
|
final int i = 6;
|
|
|
|
M: {
|
|
|
|
class A {
|
|
|
|
{
|
|
|
|
if (i != 5) break M;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
System.out.println("failed : " + i);
|
|
|
|
}
|
|
|
|
System.out.println("passed : " + i);
|
|
|
|
}
|
|
|
|
}
|