Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 540463

Summary: NPE during diagram closing
Product: [Modeling] Sirius Reporter: Pavel Bogdanov <pavel.bogdanov>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: kirill.balod, pierre-charles.david, pierre.guilet
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Pavel Bogdanov CLA 2018-10-25 07:44:31 EDT
Hello, this bug reproduces mostly on diagram closing - there is an exception in log about NPE, as I understand the cause is the checking of calculateEnabled() during InsertAction creation:
java.lang.NullPointerException
       at org.eclipse.emf.transaction.impl.TransactionImpl.start(TransactionImpl.java:257)
       at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.startTransaction(TransactionalEditingDomainImpl.java:424)
       at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:321)
       at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
       at org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDDiagramEditPart.getCommand(AbstractDDiagramEditPart.java:393)
       at org.eclipse.gmf.runtime.diagram.ui.internal.actions.InsertAction.createInsertCommand(InsertAction.java:80)
       at org.eclipse.gmf.runtime.diagram.ui.internal.actions.InsertAction.calculateEnabled(InsertAction.java:91)
       at org.eclipse.gef.ui.actions.WorkbenchPartAction.refresh(WorkbenchPartAction.java:131)
       at org.eclipse.gef.ui.actions.SelectionAction.handleSelectionChanged(SelectionAction.java:89)
       at org.eclipse.gef.ui.actions.SelectionAction.setSelection(SelectionAction.java:101)
       at org.eclipse.gef.ui.actions.SelectionAction.update(SelectionAction.java:124)
       at org.eclipse.gef.ui.parts.GraphicalEditor.updateActions(GraphicalEditor.java:458)
       at org.eclipse.gef.ui.parts.GraphicalEditor.selectionChanged(GraphicalEditor.java:401)
       at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(DiagramDocumentEditor.java:312)
       at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.selectionChanged(DDiagramEditorImpl.java:1051)
       at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:259)
       at org.eclipse.ui.internal.e4.compatibility.SelectionService.handleSelectionChanged(SelectionService.java:108)
       at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$0(SelectionService.java:92)
       at org.eclipse.ui.internal.e4.compatibility.SelectionService$1.selectionChanged(SelectionService.java:67)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$2.run(SelectionAggregator.java:126)
       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyListeners(SelectionAggregator.java:123)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.access$6(SelectionAggregator.java:121)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$7$1.run(SelectionAggregator.java:231)
       at org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:56)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$7.changed(SelectionAggregator.java:228)
       at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:114)
       at org.eclipse.e4.core.internal.contexts.EclipseContext.runAndTrack(EclipseContext.java:325)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.track(SelectionAggregator.java:213)
       at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.setPart(SelectionAggregator.java:117)
       at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
       at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:90)
       at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
       at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:344)
       at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:359)
       at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:664)
       at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:670)
       at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:53)
       at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:747)
       at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:682)
       at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:677)
       at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:1345)
       at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:1590)
       at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:1541)
       at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1511)
       at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1636)
       at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$4.run(DiagramDocumentEditor.java:502)
       at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
       at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
       at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
       at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
       at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
       at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
       at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
       at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
       at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
       at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
       at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
       at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
       at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
       at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
       at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
       at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Comment 1 Pierre-Charles David CLA 2018-11-23 10:45:03 EST
Hi, thanks for the report.

I know it's been a month, but do you remember any particular detail about the situation which triggered this? Which version of Sirius were you using?
Comment 2 Kirill Balod CLA 2018-11-25 05:51:54 EST
Hi, the following versions of components used:
org.eclipse.sirius.runtime_5.1.1.201801311428
org.eclipse.gef_3.11.0.201606061308
org.eclipse.gmf_1.10.0.201606071959
Comment 3 Pierre Guilet CLA 2019-01-08 09:32:08 EST
Hi,

Can you provide us steps to reproduce the issue?
Was your diagram dirty when closing it?
Were you using close action or close all actions?
Did you have many editors opened?

Regards
Comment 4 Pierre-Charles David CLA 2020-05-04 11:51:55 EDT
Fixed for Sirius 6.3.1 as bug #561485 (we found it separately and reported a duplicate of this one).

*** This bug has been marked as a duplicate of bug 561485 ***