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

Bug 354304

Summary: [all diagrams]QN not updated when element moved in model explorer
Product: [Modeling] Papyrus Reporter: Raphael Faudou <raphael.faudou>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P4 CC: alain.leguennec, alexia.allanic, arthur.daussy, Chokri.Mraidha, cletavernier, eclipse-bugzilla, faure.tristan, wgwolf
Version: 0.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Raphael Faudou CLA 2011-08-09 17:09:07 EDT
When moving a class from one package to another, the Qualified Name should be updated in all open diagrams. This is not the case. True for all diagrams and not only class diagram.
Probably a listener missing.
Comment 1 Arthur Daussy CLA 2011-09-14 11:34:06 EDT
Corrected on the 0.8.X branch and I have made a backporting on the trunk.
Comment 2 Alain Le Guennec CLA 2011-09-15 16:20:54 EDT
Unfortunately, you introduced a quite severe regression when fixing this issue (in rev 5440):
For instance, if you have a block displayed on a BDD, and you delete it from the model explorer, the block's graphical part will not be removed because an exception is raised in QualifiedNameDisplayEditPolicy during the delete (causing an "Uncaught exception during post-commit listener notifications").
From then on, the model is corrupted.
The issue should be REOPENED.

java.lang.NullPointerException
	at org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.addParentListeners(QualifiedNameDisplayEditPolicy.java:201)
	at org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.notifyChanged(QualifiedNameDisplayEditPolicy.java:186)
	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.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.modelexplorer.handler.AbstractCommandHandler.execute(AbstractCommandHandler.java:150)
	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.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:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	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 3 Raphael Faudou CLA 2011-09-16 02:50:56 EDT
Introduced a strong regression. Solution to be changed to avoid this regression.
Comment 4 Raphael Faudou CLA 2011-09-16 02:58:48 EDT
Alain, can you please attach or send a list of test scenarii that we could test before committing?
If you can attach a representative model, that would be good.
Comment 5 Sébastien Gérard CLA 2011-09-16 03:31:14 EDT
*** Bug 357644 has been marked as a duplicate of this bug. ***
Comment 6 alexia.allanic CLA 2011-09-16 04:19:18 EDT
I'm looking to it and commit this morning
Comment 7 Mathieu Velten CLA 2011-09-16 05:06:41 EDT
fixed and commited on branch and trunk.
Comment 8 Alain Le Guennec CLA 2011-09-16 09:21:36 EDT
Looks ok now (at least, element deletion is propagated to graphical elements).
Thanks!
Comment 9 Raphael Faudou CLA 2011-09-24 07:46:12 EDT
Verified-> on move and on delete => OK
close
Comment 10 Raphael Faudou CLA 2011-09-24 07:46:32 EDT
closed