Bug 138897 - Error ranges for unreachable code
Summary: Error ranges for unreachable code
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-27 08:58 EDT by Martin Aeschlimann CLA
Modified: 2007-03-20 11:41 EDT (History)
0 users

See Also:


Attachments
Proposed fix (1.47 KB, patch)
2007-02-02 11:08 EST, Olivier Thomann CLA
no flags Details | Diff
Complete fix (48.25 KB, patch)
2007-02-08 10:21 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2006-04-27 08:58:50 EDT
20060427

In the following code the last statement is unreachable. The error range however is only the variable name. Would better be the full statement.

public class E {
	public String getName() {
		try{
			return "fred";
		}
		catch (Exception e){
			return e.getLocalizedMessage();
		}
		int i= 9;
	}
}

In the second example the method invocation is highlighted. Probably better to highlight the full statement.

public class E {
	public String getName() {
		try{
			return "fred";
		}
		catch (Exception e){
			return e.getLocalizedMessage();
		}
		System.err.print("wow");
	}
}
Comment 1 Olivier Thomann CLA 2007-02-02 11:08:00 EST
Created attachment 58122 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2007-02-08 10:21:01 EST
Created attachment 58560 [details]
Complete fix
Comment 3 Olivier Thomann CLA 2007-02-08 11:33:02 EST
Released for 3.3M6.
Updated existing regression tests.
Comment 4 David Audel CLA 2007-03-20 11:41:10 EDT
Verified for 3.3 M6 using build I20070320-0010