Bug 433859 - NPE when closing a project containing an opened VSM
Summary: NPE when closing a project containing an opened VSM
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0M6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
: 540296 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-30 10:36 EDT by Pierre-Charles David CLA
Modified: 2018-11-23 10:47 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2014-04-30 10:36:55 EDT
Steps to reproduce:
1. Create a basic project, create a VSM inside and open it in the VSM editor.
2. Close the project.

It works, but produces a new entry in the error log:

eclipse.buildId=4.4.0.I20140306-1200
java.version=1.8.0
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=fr_FR
Command-line arguments:  -os linux -ws gtk -arch x86_64

org.eclipse.ui
Error
Wed Apr 30 16:29:57 CEST 2014
Unhandled event loop exception

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4441)
	at org.eclipse.swt.SWT.error(SWT.java:4356)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3748)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3396)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1122)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1006)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:147)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:630)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:574)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:133)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
	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:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.NullPointerException
	at org.eclipse.ui.part.MultiPageEditorPart.deactivateSite(MultiPageEditorPart.java:930)
	at org.eclipse.ui.part.MultiPageEditorPart.dispose(MultiPageEditorPart.java:501)
	at org.eclipse.sirius.editor.editorPlugin.SiriusEditor.dispose(SiriusEditor.java:1319)
	at org.eclipse.sirius.editor.tools.internal.presentation.CustomSiriusEditor.dispose(CustomSiriusEditor.java:370)
	at org.eclipse.sirius.editor.editorPlugin.SiriusEditor$3$1.run(SiriusEditor.java:409)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	... 24 more


org.eclipse.sirius.editor.editorPlugin.SiriusEditor$3$1.run(SiriusEditor.java:409) seems to be the culprit: on the line above we explicitly close the editor, which already calls dispose() on it, and then on line 409 we call dispose() again. dispose() then tries to access resources which were already removed before. The code in SiriusEditor is very old, maybe it dates from old versions of Eclipse where closing the editor did not call dispose? We need to check if the NPE is specific to Luna, to e4, or if it is present in all the releases we support.
Comment 1 Pierre-Charles David CLA 2018-11-23 10:47:11 EST
*** Bug 540296 has been marked as a duplicate of this bug. ***