Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329783 - [Class Diagram] Model element may be lost during a move in the ModelExplorer
Summary: [Class Diagram] Model element may be lost during a move in the ModelExplorer
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: 0.7.0   Edit
Assignee: Patrick Tessier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 08:47 EST by Yann Tanguy CLA
Modified: 2010-11-30 05:45 EST (History)
0 users

See Also:


Attachments
Moving nested Class (13.26 KB, image/png)
2010-11-09 08:48 EST, Yann Tanguy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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);
					}
				}