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

Bug 370135

Summary: Rename refactoring results in fully qualified names
Product: [Tools] Xtend Reporter: Ed Merks <Ed.Merks>
Component: CoreAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, mkomor, moritz.eysholdt, sebastian.zarnekow, sven.efftinge, xtend-inbox
Version: 2.2.0Flags: sven.efftinge: juno+
Target Milestone: M7   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Ed Merks CLA 2012-01-30 10:11:38 EST
This appears to be a general problem with Xtext's support for rename refactoring. I have the same problem in Xcore as I see in Xtend... 

Consider what happens when you have two Xtend files in two different packages.

package com.example

class Foo {
}

and 

package com.example.a

import com.example.Foo

class A  extends Foo {
}

If you rename Foo to FooBar, you end with with A like this:

package com.example.a

import com.example.FooBar

class A  extends com.example.FooBar {
}

When I look at how this works in the underlying framework, the rewrites are collected for preview purposes before they are applied to the real resources or model instances.  So when the reference to FooBar is serialized in A, there is no import for it yet, i.e., the old "import com.example.Foo" doesn't help to convince the serializer to produce FooBar rather than com.example.FooBar.
Comment 1 Sven Efftinge CLA 2012-01-31 05:17:07 EST
*** Bug 365182 has been marked as a duplicate of this bug. ***
Comment 2 Jan Koehnlein CLA 2012-05-03 08:31:17 EDT
A first shot commited to MASTER.

Now writing more tests...
Comment 3 Jan Koehnlein CLA 2012-05-03 09:15:11 EDT
Pushed tests to MASTER.
Comment 4 Sebastian Zarnekow CLA 2012-05-03 09:19:15 EDT
Woohoo, nice!
Comment 5 Eclipse Webmaster CLA 2017-10-31 11:24:48 EDT
Requested via bug 522520.

-M.