Bug 175834 - [assist] already defined name is proposed as variable name
Summary: [assist] already defined name is proposed as variable name
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-28 09:20 EST by David Audel CLA
Modified: 2007-03-20 08:04 EDT (History)
0 users

See Also:


Attachments
Proposed fix (3.65 KB, patch)
2007-02-28 09:29 EST, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2007-02-28 09:20:08 EST
build I20070222-0951

1) create Test.java
package test;
public class Test {
	void bar() {
		/**/int varzz| // complete at |
		{
			int varzz1 = 0;
			varzz1 = 0;
		}
		int varzz2 = 0;
		#
	}
}

2) Do ctrl + space at |

varzz1 is proposed and shouldn't.
Comment 1 David Audel CLA 2007-02-28 09:29:52 EST
Created attachment 59976 [details]
Proposed fix

CompletionParser#parseStatementsAfterCompletion() must start in recovery mode to not loose some correct nodes.
Comment 2 David Audel CLA 2007-02-28 09:34:46 EST
Released for 3.3M6.

Test added
  CompletionTests#testCompletionVariableName36()
Comment 3 Maxime Daniel CLA 2007-03-20 08:04:50 EDT
Verified for 3.3 M6 using build I20070320-0010.