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

Bug 359684

Summary: [Class Diagram] Restore Related Elements with association add an extra association
Product: [Modeling] Papyrus Reporter: Arthur Daussy <arthur.daussy>
Component: DiagramAssignee: Project Inbox <mdt-papyrus-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: arthur.daussy, borlander, papyrus-bugs, Patrick.Tessier, tischenko
Version: 0.10.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Arthur Daussy CLA 2011-10-03 06:01:49 EDT
How to reproduce:
 -> Create 3 class : Class0, Class1 and Class2
 -> Create 2 association : Class0 -> Class1 and Class -> Class2
 -> Hide those associations
 -> Try to restore related link action (contextual menu navigate -> Restore Related Elements
 -> Two extra association are created between Class0 -> Class0

This problem come from the methods:
org.eclipse.papyrus.diagram.clazz.part.UMLDiagramUpdater.getIncomingTypeModelFacetLinks_Association_4001(Type, Map<EObject, Collection<Setting>>)

This method will return an UMLNodeDescriptor src = Class0 and taget = Class0
Comment 1 Arthur Daussy CLA 2011-10-03 06:19:16 EDT
To correct this problem a quick fix has been implemented:
 The method getIncomingTypeModelFacetLinks has been tagged @generated not.
 And the following assertion has been used:
 If the "target" argument of getIncomingTypeModelFacetLinks is the first element of the list getEndTypes element this means that this element is the starting point of the association.

This point has to be discussed on the dev list.

I will not close this bug until validation from dev list.

Commit on the branch 0.8.X with commit number 5666.
Comment 2 Arthur Daussy CLA 2011-10-03 08:52:30 EDT
Same fix has been used in the Use Case Diagram.
See bug:
359696: [Use Case Diagram] Add to the Use Case Diagram the Restore Related Elements Action
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359696
Comment 3 Camille Letavernier CLA 2013-09-10 04:56:43 EDT
Still valid in 0.10.0
Comment 4 Michael Golubev CLA 2014-10-23 10:07:53 EDT
Should be covered by already merged gerrit: https://git.eclipse.org/r/34447 in master.

*** This bug has been marked as a duplicate of bug 428055 ***
Comment 5 Michael Golubev CLA 2014-10-23 10:09:43 EDT
Oops, gerrit is not actually merged yet. But it is duplicate anyway.