Bug 456696 - NPE on DDiagramElement in manual refresh on detached target
Summary: NPE on DDiagramElement in manual refresh on detached target
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-01-05 11:41 EST by Esteban DUGUEPEROUX CLA
Modified: 2018-12-18 04:44 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 Esteban DUGUEPEROUX CLA 2015-01-05 11:41:51 EST
I get the following NPE on contextual menu in the diagram editor on a node whose target is detached :

java.lang.NullPointerException
	at org.eclipse.sirius.diagram.business.api.query.ToolSectionQuery.getOperationActions(ToolSectionQuery.java:81)
	at org.eclipse.sirius.diagram.ui.tools.internal.menu.PopupMenuContribution.contributeToPopupMenu(PopupMenuContribution.java:152)
	at org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.ContributeToPopupMenuOperation.execute(ContributeToPopupMenuOperation.java:75)
	at org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy$4.execute(ExecutionStrategy.java:181)
	at org.eclipse.gmf.runtime.common.core.service.Service.execute(Service.java:651)
	at org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.execute(ContributionItemService.java:293)
	at org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.contributeToPopupMenu(ContributionItemService.java:254)
	at org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider$1.run(DiagramEditorContextMenuProvider.java:107)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
	at org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider.buildContextMenu(DiagramEditorContextMenuProvider.java:104)
	at org.eclipse.gef.ContextMenuProvider.menuAboutToShow(ContextMenuProvider.java:63)
	at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:342)
	at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:473)
	at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:469)
	at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:495)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255)

Scenario to reproduce : 

1. Disable the auto refresh
2. Create a Modeling Project
3. Add My.ecore
4. Enable Design Viewpoint
5. Open the automatically created "package entities" diagram
6. Create a EPackage with the palette 
7. Create a new "package entites" diagram from the created EPackage with the contextual menu and save
8. on the second diagram create a EPackage without saving
9. on the Ecore Editor, outside Sirius Session, delete the firstly created EPackage and save => a popup propose to reload the session, this popup is proposed only if the resource to reload is a semantic one is modified.
10. Go back to the second diagram, we see the second created EPackage with a red cross indicating that its target is detached, enable the contextual menu on it and you get the previous NPE.