Skip to content

Stale proxy URIs after changing resource URI during copy refactoring #3587

@mx990

Description

@mx990

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions