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

Bug 365635

Summary: [SysML Block Definition Diagram] Model corruption when deleting a part within a block compartment if the part is also displayed as an association end.
Product: [Modeling] Papyrus Reporter: Alain Le Guennec <alain.leguennec>
Component: CoreAssignee: Yann Tanguy <yann.tanguy>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: eclipse-bugzilla, yann.tanguy
Version: 0.8.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The model used to reproduced the issue. none

Description Alain Le Guennec CLA 2011-12-05 12:05:20 EST
Created attachment 207931 [details]
The model used to reproduced the issue.

Take the attached model, and open its BDD.
Select the "block2" part in Block1's part compartment, and execute "delete selected element".
=> An uncaught exception is raised:
Uncaught exception during post-commit listener notifications
java.lang.NullPointerException
	at org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart.refreshVisuals(AssociationEditPart.java:128)
	at org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart.handleNotificationEvent(AssociationEditPart.java:96)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.notifyChanged(ConnectionEditPart.java:1731)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.fireNotification(DiagramEventBroker.java:500)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.resourceSetChanged(DiagramEventBroker.java:395)
	at org.eclipse.gmf.runtime.diagram.ui.DiagramEventBrokerThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe.java:73)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl$1.run(TransactionalEditingDomainImpl.java:781)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.postcommit(TransactionalEditingDomainImpl.java:771)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
	at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
	at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:155)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	at org.eclipse.papyrus.commands.CheckedOperationHistory.execute(CheckedOperationHistory.java:182)
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	at org.eclipse.papyrus.diagram.common.handlers.GraphicalCommandHandler.execute(GraphicalCommandHandler.java:92)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Comment 1 Yann Tanguy CLA 2011-12-06 08:36:34 EST
An incorrect semantic edit policy was provided for child label nodes (DefaultChildLabelEditPart) which resulted in incorrect delete command (not using the edit service).

Fixed in 0.8.X (r6355) & trunk (r6356)