2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-07-02 19:04:04 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 4695463
|
|
|
|
* @summary DA versus switch: javac allows reference to uninitialized variable
|
|
|
|
* @author Neal Gafter (gafter)
|
|
|
|
*
|
2014-07-02 19:04:04 +00:00
|
|
|
* @compile/fail/ref=DASwitch.out -XDrawDiagnostics DASwitch.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class DASwitch {
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2007-12-01 00:00:00 +00:00
|
|
|
int t = 1;
|
|
|
|
{
|
|
|
|
final int x;
|
|
|
|
x = 1;
|
|
|
|
}
|
|
|
|
switch(t) {
|
|
|
|
case 0:
|
|
|
|
Integer b;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
System.out.println(b.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|