Skip to content

Conversation

@mx990
Copy link
Contributor

@mx990 mx990 commented Jan 26, 2026

When performing a COPY refactoring, the ResourceRelocationContext created the resource with the original URI and then changed the URI of the resource after loading. This left 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 was created on demand and any local references were resolved into that resource and not the copy.

This avoids the problem by creating the resource with the destination URI instead, so that any proxies will be created with the correct URI.

Fixes #3587

When performing a COPY refactoring, the ResourceRelocationContext
created the resource with the original URI and then changed the URI of
the resource after loading. This left 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 was created on demand
and any local references were resolved into that resource and not the
copy.

This avoids the problem by creating the resource with the destination
URI instead, so that any proxies will be created with the correct URI.
@github-actions
Copy link

github-actions bot commented Jan 26, 2026

Test Results

  6 465 files  + 1 614    6 465 suites  +1 614   3h 37m 47s ⏱️ + 1h 14m 38s
 43 241 tests +     5   42 657 ✅ +     5    584 💤 ±  0  0 ❌ ±0 
170 237 runs  +42 527  167 900 ✅ +41 943  2 337 💤 +584  0 ❌ ±0 

Results for commit f871b91. ± Comparison against base commit d53cb3c.

♻️ This comment has been updated with latest results.

@cdietrich
Copy link
Contributor

Wonder if this can somehow be tested

@LorenzoBettini
Copy link
Contributor

@mx990 just for confirmation: are the added tests FAIL without your patch?
Just to be sure tests are effective.

@mx990
Copy link
Contributor Author

mx990 commented Jan 27, 2026

Yes, (most of) the added tests fail without my patch when running them locally against main.

@mx990 mx990 force-pushed the refactoring-copy-uri-fix branch from a69c9c0 to d083cf6 Compare January 27, 2026 15:11
@@ -0,0 +1,175 @@
/**
* Copyright (c) 2017, 2020 TypeFox GmbH (http://www.typefox.io) and others.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 2026

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import org.junit.runner.RunWith;

/**
* @author koehnlein - Initial contribution and API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add you here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This adds tests for the copy resource refactoring based on the Java
copy processor.
@mx990 mx990 force-pushed the refactoring-copy-uri-fix branch from d083cf6 to f871b91 Compare January 29, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stale proxy URIs after changing resource URI during copy refactoring

3 participants