When performing a COPY refactoring, the ResourceRelocationContext currently creates the resource with the original URI and then changes the URI of the resource after loading:
|
case COPY: |
|
Resource copy = resourceSet.createResource(change.getFromURI()); |
|
try { |
|
copy.load(resourceSet.getURIConverter().createInputStream(change.getFromURI()), null); |
|
} catch (IOException e) { |
|
Exceptions.sneakyThrow(e); |
|
} |
|
copy.setURI(change.getToURI()); |
|
return copy; |
This leaves any proxy URIs in the loaded resource still pointing to the original file. When later resolving the proxies, a second resource for the original file will be created on demand and any local references will be resolved into that resource and not the copy.
When performing a
COPYrefactoring, theResourceRelocationContextcurrently creates the resource with the original URI and then changes the URI of the resource after loading:xtext/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/refactoring/ResourceRelocationContext.java
Lines 67 to 75 in d53cb3c
This leaves any proxy URIs in the loaded resource still pointing to the original file. When later resolving the proxies, a second resource for the original file will be created on demand and any local references will be resolved into that resource and not the copy.