jdk-24/test/langtools/tools/javac/T6306967.java

21 lines
425 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
2007-12-01 00:00:00 +00:00
* @bug 6306967
* @summary Variable x is used before initialized
* @author Wei Tao
* @compile/fail/ref=T6306967.out -XDrawDiagnostics T6306967.java
2007-12-01 00:00:00 +00:00
*/
public class T6306967 {
public static void meth() {
2007-12-01 00:00:00 +00:00
final int x;
while(true) {
if (true) {
break;
}
x = 1;
}
System.out.println(x);
}
}