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

Bug 447727

Summary: Unable to drag and drop a border node on list
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: DiagramAssignee: Florian Barbin <florian.barbin>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: belqassim.djafer, florian.barbin, mickael.lanoe, pierre-charles.david
Version: 1.0.1Keywords: triaged
Target Milestone: 3.0.0M5   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 428079, 437370    
Attachments:
Description Flags
Reproduction case none

Description Maxime Porhel CLA 2014-10-17 11:18:33 EDT
A ClassCastException occurs when dropping a border node on a list: DNode cannot be cast  to DNodeListElement. 

See the corresponding/similar stack for other similar problems in Bug 428079 and Bug 437370.

We should correct those 3 similar issues at the same time, I do not mark them as duplicate as they propose three different reproduction cases and three really different technical cases but the correction might be done in the same code area.
Comment 1 Maxime Porhel CLA 2014-11-06 09:35:20 EST
The ClassCastException:

org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
	at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:75)
	at ...
	at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
	at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
	at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.executeCurrentCommand(DragEditPartsTrackerEx.java:151)
	at org.eclipse.gef.tools.DragEditPartsTracker.performDrag(DragEditPartsTracker.java:496)
	at ...
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.ClassCastException: org.eclipse.sirius.diagram.business.internal.metamodel.spec.DNodeSpec cannot be cast to org.eclipse.sirius.diagram.DNodeListElement
	at org.eclipse.sirius.diagram.business.internal.helper.task.DnDTasksOperations$1.execute(DnDTasksOperations.java:127)
	at org.eclipse.sirius.business.api.helper.task.TaskExecutor.operation(TaskExecutor.java:95)
	at org.eclipse.sirius.business.api.helper.task.TaskExecutor.execute(TaskExecutor.java:65)
	at org.eclipse.sirius.tools.api.command.SiriusCommand.doExecute(SiriusCommand.java:80)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at ...
	at org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusContainerDropPolicy$1.execute(SiriusContainerDropPolicy.java:259)
	at ...
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.sirius.diagram.ui.tools.internal.commands.WrappingCommandIgnoringAffectedFiles.execute(WrappingCommandIgnoringAffectedFiles.java:124)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	... 44 more
Comment 2 Maxime Porhel CLA 2014-11-06 09:40:40 EST
Created attachment 248459 [details]
Reproduction case

Steps to reproduce: 
 . Import the attached projet
 . Open a session 
 . Open the "bug447727" diagram
 . Drag and drop the list element from NewEClass1 to NewEClass2: OK
 . Drag and drop the border node from NewEClass1 to NewEClass2: KO
Comment 3 Mickael LANOE CLA 2014-12-05 03:14:47 EST
currently working on it
Comment 4 Florian Barbin CLA 2014-12-05 03:21:55 EST
The work is currently in progress in the case of bug 428079. See https://git.eclipse.org/r/#/c/37587
Comment 6 Belqassim Djafer CLA 2015-04-09 10:27:40 EDT
Verified on Sirius 3.0.0M6
Comment 7 Pierre-Charles David CLA 2015-06-24 11:12:54 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.