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

Bug 329783

Summary: [Class Diagram] Model element may be lost during a move in the ModelExplorer
Product: [Modeling] Papyrus Reporter: Yann Tanguy <yann.tanguy>
Component: CoreAssignee: Patrick Tessier <Patrick.Tessier>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: 0.7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Moving nested Class none

Description Yann Tanguy CLA 2010-11-09 08:47:32 EST
Moving a NestedClass in the model explorer to another location may result in the Class being destroyed.

See the attached screenshot showing how the Nested Class is moved.
Comment 1 Yann Tanguy CLA 2010-11-09 08:48:56 EST
Created attachment 182712 [details]
Moving nested Class

Doing this move action the moved nested Class disappear from model.
Comment 2 Patrick Tessier CLA 2010-11-30 05:45:39 EST
fixed in the revision 3382
The bug was due about the target of the drop and dropped element was the same.
So it was removed from the list for the set command

To prevent this bug a test has been added as follow:

	if(!newElement.equals(objectLocation)){
					tmp.remove(newElement);
					//normally tmp.indexOf(objectLocation)!= -1 
					//if this the case objectlocation=new element and
					//it has been removed
					int indexObject=tmp.indexOf(objectLocation);
					if( before&& indexObject!=-1){
						tmp.add(tmp.indexOf(objectLocation), newElement);
					}
					else if( !before&& indexObject!=-1){
						tmp.add(tmp.indexOf(objectLocation)+1, newElement);
					}
				}