Bug 7000 - Switch and Try statement doesn't include trailing }
Summary: Switch and Try statement doesn't include trailing }
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-17 10:50 EST by Dirk Baeumer CLA
Modified: 2002-01-14 10:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2001-12-17 10:50:26 EST
class A {
	public void foo() {
		int i= 0;
		switch(i) {
		}
	}
}

Range of switch statement in source [48,63], but source end of switch node is 
62. To be consistent with a block the sourceEnd should include the trailing }.
Same is true for a try statement.
Comment 1 Philipe Mulet CLA 2001-12-18 04:55:18 EST
Agreed
Comment 2 Olivier Thomann CLA 2002-01-08 14:42:23 EST
Do we want to fix it in the actual parser or do we want to wait for the new AST 
nodes?
Comment 3 Dirk Baeumer CLA 2002-01-09 03:37:49 EST
We have a work around for this in the current refactorings. Its ok to fix it in 
the new AST
Comment 4 Olivier Thomann CLA 2002-01-09 13:33:22 EST
I wanted to prevent from changing the positions inside the compiler AST nodes, 
but I discovered some inconsistencies for the end position of if statements.
Then I update the positions of switch, try, if statements and the right start 
positions for parameters (void foo(final String s) now starts on the f of 
final).
I will send you an updated parser and you can try it. Let me know asap if this 
is fine for you.
Comment 5 Olivier Thomann CLA 2002-01-11 10:16:55 EST
I will release changes that set the right positions for the try and switch 
statements. It fixes also inconsistencies in the if statements positions and 
fixes the source start of the argument.
It will be up to you to fix the refactoring according to these changes. Let me 
know before end of today if you have any problem with that.
Comment 6 Olivier Thomann CLA 2002-01-11 15:13:15 EST
Fixed and released in HEAD.