Investigation: e4xmi refactoring issue requires fix in eclipse.jdt.ui repository #3418
+0
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Summary
This PR documents the investigation of issue #1169: "[e4][editor] refactoring produces garbage in fragment.e4xmi"
Investigation Findings
After extensive investigation of the eclipse.platform.ui repository, I've determined that this issue cannot be fixed in this repository. The problem requires changes in the eclipse.jdt.ui repository instead.
Root Cause
When refactoring Java class names in Eclipse, JDT's rename refactoring updates references in e4xmi files. However, it appears to use simple text search-and-replace without understanding the structure of bundleclass URIs or inner class references.
For example, when renaming a class
MyParttoNewPart, the following e4xmi entries exist:The text-based replacement can produce "garbage" results because:
MyPart$MyHandleris an inner class referencebundleclass://bundle/fully.qualified.ClassNamerequires special handlingEvidence from Investigation
NLSAccessorFieldRenameParticipantin JDT that handles NLS field renames, indicating the pattern to followRequired Solution
The fix needs to be implemented in eclipse.jdt.ui by creating a rename participant that:
bundleclass://bundle.name/fully.qualified.ClassName)ClassName$InnerClass)Repository Context
This PR is being closed as the work cannot be completed in eclipse.platform.ui. A new issue should be opened in the eclipse.jdt.ui repository to implement the required rename participant.
References
bundleclass://symbolic.bundle.name/fully.qualified.ClassNamebundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.javaOriginal prompt
Fixes #1169
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.