Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak for actions contributed for popup menu #176

Closed
lredor opened this issue Nov 27, 2023 · 3 comments · Fixed by #177
Closed

Memory leak for actions contributed for popup menu #176

lredor opened this issue Nov 27, 2023 · 3 comments · Fixed by #177
Assignees
Labels
component: diagrams type: bug Something isn't working
Milestone

Comments

@lredor
Copy link
Contributor

lredor commented Nov 27, 2023

This issue is a sub part of #144. It concerns memory leak about some actions used in popup menu.

Steps to reproduce:

@lredor
Copy link
Contributor Author

lredor commented Nov 27, 2023

Analysis: During a debugging session, I noticed that in the above scenario, 3 instances of org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction are created:

  • A first is created during the opening of the editor, through the org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor. In this context, the action is created in an ActionRegistry for a IWorkbenchPartDescriptor having org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor as partClass (part class is get from org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor.getEditorClass()).
Thread [main] (Suspended (breakpoint at line 42 in org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction))	
	org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction.<init>(org.eclipse.ui.IWorkbenchPage) line: 42	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider.createAction(java.lang.String, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 309	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).getAction(java.lang.String, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 475	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).getAction(java.lang.String, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor, org.eclipse.gmf.runtime.common.ui.util.IPartSelector) line: 521	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider$ActionContributionItemAdapter.getAdapter(java.lang.Class) line: 888	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).contributeItem(org.eclipse.core.runtime.IAdaptable, org.eclipse.jface.action.IContributionManager, java.lang.String, java.lang.String) line: 754	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).contributeToActionBars(org.eclipse.ui.IActionBars, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor, boolean) line: 244	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).contributeToActionBars(org.eclipse.ui.IActionBars, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 155	
	org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.ContributeToActionBarsOperation.execute(org.eclipse.gmf.runtime.common.core.service.IProvider) line: 75	
	org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy$4.execute(org.eclipse.gmf.runtime.common.core.service.Service, org.eclipse.gmf.runtime.common.core.service.IOperation) line: 182	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService(org.eclipse.gmf.runtime.common.core.service.Service).execute(org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy, org.eclipse.gmf.runtime.common.core.service.IOperation) line: 652	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.execute(org.eclipse.gmf.runtime.common.core.service.IOperation) line: 294	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.contributeToActionBars(org.eclipse.ui.IActionBars, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 242	
	org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor).init(org.eclipse.ui.IActionBars) line: 76	
	org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor.init(org.eclipse.ui.IActionBars) line: 229	
	org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor(org.eclipse.ui.part.EditorActionBarContributor).init(org.eclipse.ui.IActionBars, org.eclipse.ui.IWorkbenchPage) line: 153	
	org.eclipse.ui.internal.EditorReference.createEditorActionBars(org.eclipse.ui.internal.WorkbenchPage, org.eclipse.ui.internal.registry.EditorDescriptor) line: 434	
	org.eclipse.ui.internal.EditorReference.initialize(org.eclipse.ui.IWorkbenchPart) line: 350	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).create() line: 344	
	...
	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 588	
	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1459	
	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1432	

This instance is correctly disposed during the closing of the editor (through dispose of SiriusDiagramActionBarContributor).

Thread [main] (Suspended (breakpoint at line 94 in org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction))	
	org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction(org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction).dispose() line: 94	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ActionRegistry.dispose() line: 56	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).disposeContributions(org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 434	
	org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.DisposeContributionsOperation.execute(org.eclipse.gmf.runtime.common.core.service.IProvider) line: 55	
	org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy$4.execute(org.eclipse.gmf.runtime.common.core.service.Service, org.eclipse.gmf.runtime.common.core.service.IOperation) line: 182	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService(org.eclipse.gmf.runtime.common.core.service.Service).execute(org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy, org.eclipse.gmf.runtime.common.core.service.IOperation) line: 652	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.execute(org.eclipse.gmf.runtime.common.core.service.IOperation) line: 294	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.disposeContributions(org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 262	
	org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor).dispose() line: 97	
	org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor.dispose() line: 507	
	org.eclipse.ui.internal.EditorActionBars.dispose() line: 160	
	org.eclipse.ui.internal.EditorReference.disposeEditorActionBars(org.eclipse.ui.internal.EditorActionBars) line: 463	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.disposeSite(org.eclipse.ui.internal.PartSite) line: 139	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).internalDisposeSite(org.eclipse.ui.IWorkbenchPartSite) line: 434	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).invalidate() line: 272	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).destroy() line: 421	
	...
  • A second is created, always during the opening of the editor, through the Tabbar initialization.
Thread [main] (Suspended (breakpoint at line 42 in org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction))	
	org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction.<init>(org.eclipse.ui.IWorkbenchPage) line: 42	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.contributions.TabbarContributionFactory.createFontDialogContribution(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart) line: 474	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarFillerWithContributions.addDiagramElementContributionItems() line: 225	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarFillerWithContributions.doFill() line: 88	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarFillerWithContributions(org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.AbstractTabbarFiller).fill() line: 72	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.Tabbar.fillForDiagram() line: 148	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.Tabbar.<init>(org.eclipse.swt.widgets.Composite, org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart) line: 93	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createTabbar(org.eclipse.swt.widgets.Composite, org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart) line: 1505	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createGraphicalViewer(org.eclipse.swt.widgets.Composite) line: 1476	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl(org.eclipse.gef.ui.parts.GraphicalEditor).createPartControl(org.eclipse.swt.widgets.Composite) line: 169	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor).createPartControl(org.eclipse.swt.widgets.Composite) line: 1591	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette).createPartControl(org.eclipse.swt.widgets.Composite) line: 330	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl(org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor).createPartControl(org.eclipse.swt.widgets.Composite) line: 1540	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createPartControl(org.eclipse.swt.widgets.Composite) line: 645	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).createPartControl(org.eclipse.ui.IWorkbenchPart, org.eclipse.swt.widgets.Composite) line: 158	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(org.eclipse.ui.IWorkbenchPart, org.eclipse.swt.widgets.Composite) line: 96	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).create() line: 365	
	...
	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 588	
	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1459	
	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1432	

This instance is correctly disposed during the closing of the editor.

	Thread [main] (Suspended (breakpoint at line 94 in org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction))	
	org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction(org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction).dispose() line: 94	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarToolBarManager.itemRemoved(org.eclipse.jface.action.IContributionItem) line: 78	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.TabbarToolBarManager(org.eclipse.jface.action.ContributionManager).removeAll() line: 449	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.Tabbar.dispose() line: 203	
	org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.dispose() line: 889	
	...
  • A third is created during the right click, to display the contextual menu. In this context, the action is created in an ActionRegistry for a IWorkbenchPartDescriptor having org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl as partClass (part class is get from workbenchPart.getClass() called by org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider.contributeToPopupMenu(IMenuManager, IWorkbenchPart)).
Thread [main] (Suspended (breakpoint at line 42 in org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction))	
	org.eclipse.gmf.runtime.diagram.ui.actions.internal.FontDialogAction.<init>(org.eclipse.ui.IWorkbenchPage) line: 42	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider.createAction(java.lang.String, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 309	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).getAction(java.lang.String, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) line: 475	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).getAction(java.lang.String, org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor, org.eclipse.gmf.runtime.common.ui.util.IPartSelector) line: 521	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider$ActionContributionItemAdapter.getAdapter(java.lang.Class) line: 888	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).contributeItem(org.eclipse.core.runtime.IAdaptable, org.eclipse.jface.action.IContributionManager, java.lang.String, java.lang.String) line: 754	
	org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider(org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider).contributeToPopupMenu(org.eclipse.jface.action.IMenuManager, org.eclipse.ui.IWorkbenchPart) line: 384	
	org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.ContributeToPopupMenuOperation.execute(org.eclipse.gmf.runtime.common.core.service.IProvider) line: 75	
	org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy$4.execute(org.eclipse.gmf.runtime.common.core.service.Service, org.eclipse.gmf.runtime.common.core.service.IOperation) line: 182	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService(org.eclipse.gmf.runtime.common.core.service.Service).execute(org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy, org.eclipse.gmf.runtime.common.core.service.IOperation) line: 652	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.execute(org.eclipse.gmf.runtime.common.core.service.IOperation) line: 294	
	org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.contributeToPopupMenu(org.eclipse.jface.action.IMenuManager, org.eclipse.ui.IWorkbenchPart) line: 255	
	org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider$1.run() line: 110	
	org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(java.lang.Runnable) line: 323	
	org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider.buildContextMenu(org.eclipse.jface.action.IMenuManager) line: 106	
	org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider(org.eclipse.gef.ContextMenuProvider).menuAboutToShow(org.eclipse.jface.action.IMenuManager) line: 61	
	org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider(org.eclipse.jface.action.MenuManager).fireAboutToShow(org.eclipse.jface.action.IMenuManager) line: 338	
	org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider(org.eclipse.jface.action.MenuManager).handleAboutToShow() line: 468	
	org.eclipse.jface.action.MenuManager$2.menuShown(org.eclipse.swt.events.MenuEvent) line: 495	
	...
	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 588	
	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1459	
	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1432	

This instance is never disposed. It causes the memory leak.

@lredor
Copy link
Contributor Author

lredor commented Nov 27, 2023

The third instanciation is only here because the ActionRegistry, with DDiagramEditorImpl as part of the key, does not already contain the action. The problem is that for initial creation the hardcoded value is used(SiriusDiagramActionBarContributor.getEditorClass()), while afterward the real editor class is used (workbenchPart.getClass()).
To avoid this problem, we have to override the default generated implementation of SiriusDiagramActionBarContributor.getEditorClass(); one for each SiriusDiagramEditor implementation.

lredor added a commit that referenced this issue Nov 27, 2023
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

Bug: #176
@lredor lredor self-assigned this Nov 28, 2023
@lredor lredor added type: bug Something isn't working component: diagrams labels Nov 28, 2023
lredor added a commit that referenced this issue Dec 4, 2023
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

Bug: #176
lredor added a commit that referenced this issue Dec 18, 2023
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

Bug: #176
lredor added a commit that referenced this issue Jan 17, 2024
DO NOT MERGE !

This commit is just to compare the tests execution duration with PR #177
and see if there is a performance problem, and probably analyze it.
Junit and Sequence tests suites have been significantly reduced, as they
are not affected.

Bug: #176
lredor added a commit that referenced this issue Jan 17, 2024
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

Bug: #176
lredor added a commit that referenced this issue Jan 17, 2024
DO NOT MERGE !

This commit is just to compare the tests execution duration with PR #177
and see if there is a performance problem, and probably analyze it.
Junit and Sequence tests suites have been significantly reduced, as they
are not affected.

Bug: #176
lredor added a commit that referenced this issue Mar 15, 2024
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

Bug: #176
lredor added a commit that referenced this issue Mar 15, 2024
DO NOT MERGE !

This commit is just to compare the tests execution duration with PR #177
and see if there is a performance problem, and probably analyze it.
Junit and Sequence tests suites have been significantly reduced, as they
are not affected.

Bug: #176
lredor added a commit that referenced this issue Mar 15, 2024
DO NOT MERGE !

This commit is just to compare the tests execution duration with PR #177
and see if there is a performance problem, and probably analyze it.
Junit and Sequence tests suites have been significantly reduced, as they
are not affected.

Bug: #176
lredor added a commit that referenced this issue Mar 25, 2024
DO NOT MERGE !

This commit is just to check if the fix about datatransfer is
operational on CI.

Bug: #176
lredor added a commit that referenced this issue Mar 25, 2024
DO NOT MERGE !

This commit is just to check if the fix about datatransfer is
operational on CI.

Bug: #176
@lredor
Copy link
Contributor Author

lredor commented Mar 26, 2024

After several analysis, the performance problem with this leak fix occurs only for Linux users using X11. Indeed, the performance problem is caused by a default timeout of 10 seconds (sun.awt.UNIXToolkit.DEFAULT_DATATRANSFER_TIMEOUT, for example here).
This timeout occurs in some tests during sun.awt.datatransfer.SunClipboard.addFlavorListener(FlavorListener), during the creation of PasteImageAction (see debug screenshots).
Capture d’écran du 2024-03-23 21-23-35
Capture d’écran du 2024-03-23 21-23-41
Capture d’écran du 2024-03-23 21-27-58

A solution is to reduce this timeout. For the tests, it will be set to 100ms instead of 10000ms. It has not been changed for the "standard" usage because the effect is not really under control.

lredor added a commit that referenced this issue Mar 26, 2024
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

To avoid a performance problem, the timeout
"sun.awt.datatransfer.timeout" has been set to 100 ms instead of 10000
ms for the automatic tests (see comment on issue [1] for more details).

[1] #176 (comment)

Bug: #176
@lredor lredor added this to the v7.4.2 milestone Mar 27, 2024
lredor added a commit that referenced this issue Jun 20, 2024
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

To avoid a performance problem, the timeout
"sun.awt.datatransfer.timeout" has been set to 100 ms instead of 10000
ms for the automatic tests (see comment on issue [1] for more details).

[1] #176 (comment)

Bug: #176
@pcdavid pcdavid modified the milestones: v7.4.2, v7.4.3 Jun 20, 2024
lredor added a commit that referenced this issue Jun 26, 2024
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

To avoid a performance problem, the timeout
"sun.awt.datatransfer.timeout" has been set to 100 ms instead of 10000
ms for the automatic tests (see comment on issue [1] for more details).

[1] #176 (comment)

Bug: #176
lredor added a commit that referenced this issue Jun 26, 2024
Create a specific ActionBarContributor for each specific implementation
of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for
"SiriusDiagramEditor.class" and one for real implementation
("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class").
Indeed, only one of the ActionRegistry is correctly cleaned at the
closing of the editor.

To avoid a performance problem, the timeout
"sun.awt.datatransfer.timeout" has been set to 100 ms instead of 10000
ms for the automatic tests (see comment on issue [1] for more details).

[1] #176 (comment)

Bug: #176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagrams type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants