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

Bug 438354

Summary: NPE in WorkspaceImagePathSelector if a file with no extension is in the workspace
Product: [Modeling] Sirius Reporter: Cedric Brun <cedric.brun>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: esteban.dugueperoux, pierre-charles.david
Version: 1.0.0Keywords: triaged
Target Milestone: 2.0.0   
Hardware: All   
OS: All   
Whiteboard: trivial
Bug Depends on:    
Bug Blocks: 439102, 453030    

Description Cedric Brun CLA 2014-06-27 04:57:11 EDT
Steps to reproduce : create a file with no extension.
Open a diagram
click on the button to set a workspace image
Click on browse 
=> NPE
Comment 1 Esteban DUGUEPEROUX CLA 2014-06-27 09:52:07 EDT
Reproduced : 

java.lang.NullPointerException
	at org.eclipse.sirius.diagram.ui.tools.internal.dialogs.WorkspaceImagePathSelector$FileExtensionFilter.select(WorkspaceImagePathSelector.java:96)
	at org.eclipse.sirius.diagram.ui.tools.internal.dialogs.WorkspaceImagePathSelector$FileExtensionFilter.select(WorkspaceImagePathSelector.java:106)
	at org.eclipse.jface.viewers.ViewerFilter.filter(ViewerFilter.java:51)
	at org.eclipse.ui.dialogs.ElementTreeSelectionDialog.evaluateIfTreeEmpty(ElementTreeSelectionDialog.java:403)
	at org.eclipse.ui.dialogs.ElementTreeSelectionDialog.open(ElementTreeSelectionDialog.java:239)
	at org.eclipse.sirius.common.ui.tools.api.resource.WorkspaceResourceDialogWithFilter.openFileSelection(WorkspaceResourceDialogWithFilter.java:129)
	at org.eclipse.sirius.diagram.ui.tools.internal.dialogs.WorkspaceImagePathSelector.widgetSelected(WorkspaceImagePathSelector.java:67)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
	at org.eclipse.jface.window.Window.open(Window.java:808)
	at org.eclipse.sirius.diagram.ui.business.api.image.WorkspaceImageSelector.selectImage(WorkspaceImageSelector.java:33)
	at fr.obeo.dsl.viewpoint.collab.ui.internal.image.CollabImageSelector.selectImage(CollabImageSelector.java:30)
	at org.eclipse.sirius.diagram.ui.tools.internal.actions.style.SetStyleToWorkspaceImageAction.run(SetStyleToWorkspaceImageAction.java:72)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	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:382)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 2 Esteban DUGUEPEROUX CLA 2014-06-27 09:58:18 EDT
A Gerrit change-set has been submited : https://git.eclipse.org/r/#/c/29119/
Comment 3 Esteban DUGUEPEROUX CLA 2014-07-01 08:45:56 EDT
Merged as a04c4fa9df14001303cb213587767054c6fec5fb .
Comment 4 Pierre-Charles David CLA 2014-10-27 06:52:52 EDT
Available in Sirius 2.0.0.
Comment 5 Pierre-Charles David CLA 2014-11-24 08:47:26 EST
Clone created as bug 453030 to backport for Sirius 1.0.2.