Fix E4 model perspectives being converted to orphan local copies#3972
Fix E4 model perspectives being converted to orphan local copies#3972akurtakov wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
|
Problem can be seen with IWorkbenchPageTeset.testE4PerspectiveNotConvertedToLocalCopy and WorkbenchPage changes are reverted. |
merks
left a comment
There was a problem hiding this comment.
Just one typo and one question about the test cleanup. Otherwise it looks fine.
|
|
||
| assertFalse(((PerspectiveDescriptor) descriptor).hasCustomDefinition()); | ||
|
|
||
| PlatformUI.getWorkbench().getPerspectiveRegistry().deletePerspective(descriptor); |
There was a problem hiding this comment.
Is this line cleanup for after the test to avoid this leaking into other tests? If the test fails, might this leak anyway and then cause other tests to fail too?
There was a problem hiding this comment.
Failures in other tests can occur only if the same ids are used or number of elements are checked inside the same suite. As every test suite creates new workbench it shouldn't be possible to leak into other test suites are these model changes should be gone on new startup as they are not backed by any permanent source (e.g. fragment.e4xmi). With all of the above, it is still nice to clean up when we can to prevent time lost in the future.
| // Registers an E4 perspective that is contributed directly via the application | ||
| // model (e.g. via a model fragment), without renaming it or marking it as a | ||
| // local copy. Unlike {@link #addPerspective(MPerspective)}, this method does | ||
| // not add the perspective to the application snippets. |
There was a problem hiding this comment.
It's nice that you add a description so that future developers understand the reason for the guard and the special handling.
E4 model perspectives are being made into local copies as it counted them as "orphan" with log like: ``` !ENTRY org.eclipse.ui 1 1 2026-05-06 12:00:28.236 !MESSAGE Perspective with name 'Some name' and id 'org.some.id' has been made into a local copy ``` Perspectives with contributorURI in fragments are fully defined and not orphan thus add them directly without going through orphan and local copy.
|
LGTM |
E4 model perspectives are being made into local copies as it counted them as "orphan" with log like:
Perspectives with contributorURI in fragments are fully defined and not orphan thus add them directly without going through orphan and local copy.