Bug 61430

Summary: 'unnecessary else statement' compiler option not working with 'else if' statements
Product: [Eclipse Project] JDT Reporter: Luc Bourlier <eclipse>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Linux   
Whiteboard:

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.