Community
Participate
Working Groups
If you have something like if (true) xxxx; else yyyy; You would think that since we have a constant expression that then then clause would be flagged as unreachable and vice versa. Looking at Statement.complainIfUnreachable, there seems to be some logic problem. In the case above, it will never be considered DEAD_END which will prevent the unreachable code to be reported.
This is legal code you may write as per the JLS. This is to allow if (DEBUG) constructs. This being said we have a feature request to warn about 'fake' reachable code (bug 51952).