-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
7, 8, 9, 10
-
generic
-
generic
FULL PRODUCT VERSION :
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
A DESCRIPTION OF THE PROBLEM :
compiler don't warn about unreachable code, when try/cacth/finally block exist.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
none warning/error
ACTUAL -
run without error/warning
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package test;
public class Test {
public static void main(String[] args) {
try {
return;
} catch (Exception e) {
System.out.println("catch");
} finally {
System.out.println("finally");
}
System.out.println("unreachable??!!!");
}
}
---------- END SOURCE ----------
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
A DESCRIPTION OF THE PROBLEM :
compiler don't warn about unreachable code, when try/cacth/finally block exist.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
none warning/error
ACTUAL -
run without error/warning
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package test;
public class Test {
public static void main(String[] args) {
try {
return;
} catch (Exception e) {
System.out.println("catch");
} finally {
System.out.println("finally");
}
System.out.println("unreachable??!!!");
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8200748 update implementation after spec bug JDK-8193860 has been fixed
-
- Closed
-