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

Bug 316275

Summary: [class diagram] Undo doesn't work after moving a nested classifier outside
Product: [Modeling] Papyrus Reporter: Cedric Dumoulin <cedric.dumoulin>
Component: CoreAssignee: Patrick Tessier <Patrick.Tessier>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 0.7.0   
Target Milestone: 0.7.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Cedric Dumoulin CLA 2010-06-09 08:17:02 EDT
- create a class A in a class diagram
- create nested class B inside A
- drag and drop B outside A
- do undo (ctrl-x) : an error occur:

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=4, size=4
	at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:352)
	at org.eclipse.emf.ecore.change.impl.ListChangeImpl.applyAndReverse(ListChangeImpl.java:535)
	at org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.preApply(ChangeDescriptionImpl.java:474)
	at org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.applyAndReverse(ChangeDescriptionImpl.java:321)
	at org.eclipse.emf.transaction.util.CompositeChangeDescription.applyAndReverse(CompositeChangeDescription.java:117)
	at org.eclipse.emf.workspace.AbstractEMFOperation.doUndo(AbstractEMFOperation.java:695)
	at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doUndo(AbstractTransactionalCommand.java:260)
	at org.eclipse.emf.workspace.AbstractEMFOperation.undo(AbstractEMFOperation.java:370)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doUndoWithResult(CompositeCommand.java:622)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.undo(AbstractCommand.java:216)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:415)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.undo(DefaultOperationHistory.java:1280)
	at org.eclipse.ui.operations.UndoActionHandler.runCommand(UndoActionHandler.java:78)
	at org.eclipse.ui.operations.OperationHistoryActionHandler$4.run(OperationHistoryActionHandler.java:311)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
Comment 1 Patrick Tessier CLA 2011-02-28 06:34:12 EST
it is impossible to drop outside. I change the severity of the bug to major
Comment 2 Patrick Tessier CLA 2011-08-10 04:13:19 EDT
It has been decided to not let the drop outside of an inner class .

The pb is more general. For the all label childs,the gmf layer try to do an add command on the diagram. If  the command cannot be executed, it tries to do only a drop i.e. move only the graphical element. (but the semantic has no change).

So the behavior seems strange  : sometimes this a refactor, sometimes this is only a graphical move.
Comment 3 Patrick Tessier CLA 2011-08-10 04:13:45 EDT
Done in the branch revision 5213
Comment 4 Patrick Tessier CLA 2011-08-10 04:16:23 EDT
Merge in the head 5214