Community
Participate
Working Groups
Created attachment 265602 [details] Sample file to reproduce the bug Steps to reproduce: 1. Import the projects in the attached zip. 2. Go to "Window > Preferences > Plug-in Development > Target Platforms", select the "sample" target from the workspace and validate ("OK"). 3. Close the "tp" project (where the "sample.target" is defined). 4. Restart Eclipse. 5. Go to "Window > Preferences > Plug-in Development > Target Platforms". No target is set; click "Apply" and "OK". 6. Open the VSM in vsm/sample.odesign and go to single node mapping's workspace image style 7. In the style description tab of the properties view, select the "..." button to browse the images => NPE in the error log. java.lang.NullPointerException at org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog$WorkbenchProxyObject.getChildren(WorkspaceAndPluginsResourceDialog.java:256) at org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog$CustomWorkbenchAdapter.getChildren(WorkspaceAndPluginsResourceDialog.java:396) at org.eclipse.ui.model.BaseWorkbenchContentProvider.getChildren(BaseWorkbenchContentProvider.java:60) at org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog$DeferredWorkbenchContentProvider.getChildren(WorkspaceAndPluginsResourceDialog.java:375) at org.eclipse.ui.model.BaseWorkbenchContentProvider.getElements(BaseWorkbenchContentProvider.java:67) at org.eclipse.ui.dialogs.ElementTreeSelectionDialog.evaluateIfTreeEmpty(ElementTreeSelectionDialog.java:384) at org.eclipse.ui.dialogs.ElementTreeSelectionDialog.open(ElementTreeSelectionDialog.java:235) at org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog.openDialogForImages(WorkspaceAndPluginsResourceDialog.java:139) at org.eclipse.sirius.diagram.editor.properties.sections.style.workspaceimagedescription.WorkspaceImageDescriptionWorkspacePathPropertySection$1.widgetSelected(WorkspaceImageDescriptionWorkspacePathPropertySection.java:119) Sometimes, some or all of steps 2 to 5 are not needed, and simply opening the VSM and trying to browse the image triggers the NPE. I'm not sure what are the exact underlying conditions needed, but anyway, the code in WorkspaceAndPluginsResourceDialog is not robust to the case where ITargetPlatformService.getWorkspaceTargetHandle() returns null (which is a valid return value as described in its Javadoc).
New Gerrit change created: https://git.eclipse.org/r/85835
Gerrit change https://git.eclipse.org/r/85835 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6048c9303ed9e23a1bc3be1f8cf85657d4b72fb9
Fixed by 6048c9303ed9e23a1bc3be1f8cf85657d4b72fb9. The reproduction scenario involves restarting Eclipse, to we can not include a test in our suites. It will have to be tested manually.
For now, the correction of this bug can not be homologate. Indeed, the Reproduction scenario is not possible to use because the "..." button to browse the images is not accessible.
The problem that blocks the validation will be fixed with https://git.eclipse.org/r/#/c/97634
Validated with Sirius 5.0 RC1 (In the step 5., I deselected the "Running Platform" that is selected by default).
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.