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

Bug 324306

Summary: [Composite Structure Diagram] A connector is added to wrong class, if it connects an inherited port
Product: [Modeling] Papyrus Reporter: Ansgar Radermacher <ansgar.radermacher>
Component: CoreAssignee: Ansgar Radermacher <ansgar.radermacher>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ali.koudri, vincent.lorenzo, yann.tanguy
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
First fix
none
Correction of earlier patch none

Description Ansgar Radermacher CLA 2010-09-02 09:43:48 EDT
Build Identifier: 

If you add a connector to a composite class and connect a port that has been added visually to the class but that is owned by a super-class, the connector is added to the super class, not the composite class.


Reproducible: Always

Steps to Reproduce:
1. Create a class and a port
2. Create a heir and drag the inherited port to the class.
3. Create a connection between the inherited port and an inner part
Comment 1 Ansgar Radermacher CLA 2010-10-11 10:31:44 EDT
The error is not limited to inherited ports. A connector is also added to the wrong class, if owned ports are connected.
Comment 2 Ansgar Radermacher CLA 2010-10-11 12:07:11 EDT
Created attachment 180608 [details]
First fix

A first patch which works after some testing. Modification: call deduceContainer with the parts with ports (if non null) instead of the ports.
Comment 3 Ansgar Radermacher CLA 2010-10-11 15:04:17 EDT
Created attachment 180615 [details]
Correction of earlier patch

Correction of fix
(copy&paste mistake: targetPartOrRole = target instead of ... = source)
Comment 4 Yann Tanguy CLA 2010-10-15 05:20:34 EDT
*** Bug 326932 has been marked as a duplicate of this bug. ***
Comment 5 Yann Tanguy CLA 2010-10-15 08:38:13 EDT
(r2951)

The GraphNodeEditPolicy used by Port and Property have been modified in order to keep the source / target GraphicalEditPart as request parameters.

During the creation the container of the new Connector is calculated by looking for a StructuredClassifier in graphical containers of the source / target.
The container proposed by source and target should be the same.

Let me know if this is ok for you (you can close the bug if its ok).
Comment 6 Yann Tanguy CLA 2010-10-25 09:14:08 EDT
I close this task, don't hesitate to reopen in case current implementation does not match your expectations.