Bug 61430 - 'unnecessary else statement' compiler option not working with 'else if' statements
Summary: 'unnecessary else statement' compiler option not working with 'else if' state...
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-07 13:46 EDT by Luc Bourlier CLA
Modified: 2004-05-07 15:48 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 Luc Bourlier CLA 2004-05-07 13:46:58 EDT
I20040506 + jdt.core, jdt.ui from HEAD

In the following piece of code, 'unnecessary else statement' problem is only
reported for the first 'else', no the second one.

boolean test= true;
if (test) {
  return;
} else { // problem correctly reported here
}
if (test) {
  return;
} else if (test) { // problem no reported here
}
Comment 1 Philipe Mulet CLA 2004-05-07 15:48:21 EDT
It is not flagging else-if on purpose so as to preserve this code pattern.