Compilation of the following examples successfuly complete, but error message expected.
class X {
void check_unreachable () {
try {
} catch(Exception e) {
int i = 10; // error: statement not reached
}
}
}
class X {
static void check_unreachable () {
try {
return;
} catch(Error e) {} // error: statement not reached
}
}
This behavior violates JLS 14.19
konstantin.boudnik@eng 2000-02-17
class X {
void check_unreachable () {
try {
} catch(Exception e) {
int i = 10; // error: statement not reached
}
}
}
class X {
static void check_unreachable () {
try {
return;
} catch(Error e) {} // error: statement not reached
}
}
This behavior violates JLS 14.19
konstantin.boudnik@eng 2000-02-17
- duplicates
-
JDK-4046575 JLS3 14.21 Spec for reachability doesn't consider unchecked exceptions
-
- Closed
-