The following compiles without error in both 1.2 and 1.3-L.
According to JLS 14.19, the catch blocks are unreachable.
public class Bug {
void test() {
int state = 0;
try {
// empty try cannot generate Exceptions !
}
catch (ArithmeticException e) {
state = 1;
}
catch (Exception e) {
state = 2;
}
}
}
According to JLS 14.19, the catch blocks are unreachable.
public class Bug {
void test() {
int state = 0;
try {
// empty try cannot generate Exceptions !
}
catch (ArithmeticException e) {
state = 1;
}
catch (Exception e) {
state = 2;
}
}
}
- duplicates
-
JDK-4046575 JLS3 14.21 Spec for reachability doesn't consider unchecked exceptions
-
- Closed
-