Name: mc57594 Date: 02/21/97
A statement that is correctly diagnosed as unreachable (e.g.
below) because it follows a while loop (or similar construct) whose boolean
expression is the literal 'true' is not correctly diagnosed when the
expression is another constant expression of value true.
class B {
{
do
;
while (true ? true : false); // never terminates
System.out.println("hello, world!"); // unreachable
}
}
I haven't checked the use of compile-time constants in other
contexts, i.e. I don't know whether the fault lies with the determination
of compile-time constants or the algorithm for diagnosing unreachable
statements.
======================================================================
- duplicates
-
JDK-4031259 compile-time constants not used correctly for 'unreachable statements'
- Closed