Bug 439868

Summary: [xtend][refactoring] Rename refactoring ignores names conflicts and breaks references
Product: [Tools] Xtend Reporter: Anton Kosyakov <anton>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource
Version: 2.6.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Anton Kosyakov CLA 2014-07-18 04:33:13 EDT
1. Xtend code:
class Foo {
	
	String lalala
	
	def bar(String lalala2) {
		lalala // the reference to the field 'lalala'
	}
	
}

2. Rename the argument lalala2 to lalala.
3. Rename refactoring will be completed without errors and produces the following code: 
class Foo {
	
	String lalala
	
	def bar(String lalala) {
		lalala // the reference to the argument 'lalala'
	}
	
}
4. The reference inside the 'bar' method points to the argument instead of the field.

Rename refactoring should fix affected references or at least provides an error. In that case a refactored code could look like:
class Foo {
	
	String lalala
	
	def bar(String lalala) {
		this.lalala // still the reference to the field 'lalala'
	}
	
}