The following code does NOT cause a "statement not reached error":
class x {
void f(){
int i =0;
while ( true) {
try{break;}
finally{return;}
}
i++;
}
}
Yet, if you remove the "break;", it does. The i++ statement is unreachable
in either case and should be diagnosed as such.
-kto
###@###.### 10/22/04 14:12 GMT
class x {
void f(){
int i =0;
while ( true) {
try{break;}
finally{return;}
}
i++;
}
}
Yet, if you remove the "break;", it does. The i++ statement is unreachable
in either case and should be diagnosed as such.
-kto
###@###.### 10/22/04 14:12 GMT
- relates to
-
JDK-4642762 JLS3 14.21 When can a statement complete normally? (break&continue versus finally)
- Closed