Skip to content

Fix E4 model perspectives being converted to orphan local copies#3972

Open
akurtakov wants to merge 1 commit intoeclipse-platform:masterfrom
akurtakov:master
Open

Fix E4 model perspectives being converted to orphan local copies#3972
akurtakov wants to merge 1 commit intoeclipse-platform:masterfrom
akurtakov:master

Conversation

@akurtakov
Copy link
Copy Markdown
Member

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.

@akurtakov
Copy link
Copy Markdown
Member Author

Problem can be seen with IWorkbenchPageTeset.testE4PerspectiveNotConvertedToLocalCopy and WorkbenchPage changes are reverted.

Copy link
Copy Markdown
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

Just one typo and one question about the test cleanup. Otherwise it looks fine.


assertFalse(((PerspectiveDescriptor) descriptor).hasCustomDefinition());

PlatformUI.getWorkbench().getPerspectiveRegistry().deletePerspective(descriptor);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results

   852 files  ±0     852 suites  ±0   57m 12s ⏱️ + 5m 21s
 7 941 tests +1   7 698 ✅ +1  243 💤 ±0  0 ❌ ±0 
20 325 runs  +3  19 670 ✅ +3  655 💤 ±0  0 ❌ ±0 

Results for commit 44e4be7. ± Comparison against base commit 7f682c2.

♻️ This comment has been updated with latest results.

@vogella
Copy link
Copy Markdown
Contributor

vogella commented May 6, 2026

LGTM

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.

3 participants