Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 44964

Summary: Rename doesn't work if there are any compilation errors
Product: [Eclipse Project] JDT Reporter: Brett Kotch <bkotch>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_audel
Version: 3.0   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 42253    
Bug Blocks:    

Description Brett Kotch CLA 2003-10-15 18:37:31 EDT
Type in the following code:

		int abc = 0;
		if (true) {
			 System.out.println(abc)
		}

Try to rename abc. It will fail because system.out.println doesn't have a 
semicolon. I should be allowed to rename even if there are comilation errors.
Comment 1 Martin Aeschlimann CLA 2003-10-16 06:06:24 EDT

*** This bug has been marked as a duplicate of 44983 ***
Comment 2 Frederic Fusier CLA 2006-02-15 11:05:28 EST
Verified for 3.2 M5 using build I20060215-0010.
Comment 3 Frederic Fusier CLA 2006-02-15 11:11:50 EST
Even with bug 42253 fixed, I still cannot rename the local variable.
I get following "Rename Local Variable" error dialog:
"A local variable  declaration or reference  must be selected to activate this refactoring"

Adding missing semicolon of course open correctly the refactoring dialog and local variable is the same than without semicolon => seems not to be a robust AST issue => Reopen as this is not a duplicate bug
Comment 4 Frederic Fusier CLA 2006-02-15 11:29:54 EST
Not a duplicate but depended on bug 42253
Comment 5 Martin Aeschlimann CLA 2006-02-16 05:23:09 EST
I would suggest to use an AST with recovery but unly for the rename local case.
Comment 6 Markus Keller CLA 2006-02-27 06:50:47 EST
Fixed for rename local variable.