Bug 57987 - Unreachable code not flagged
Summary: Unreachable code not flagged
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-09 00:15 EDT by Michael Fraenkel CLA
Modified: 2004-04-09 05:21 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Fraenkel CLA 2004-04-09 00:15:49 EDT
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.
Comment 1 Philipe Mulet CLA 2004-04-09 05:21:27 EDT
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).