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

Bug 360216

Summary: Stereotypes applied to association member ends spanning multiple models lost after save
Product: [Modeling] MDT.UML2 Reporter: Alexander Weickmann <alexander.weickmann>
Component: CoreAssignee: UML2 Inbox <mdt-uml2-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
JUnit Plugin Test Case none

Description Alexander Weickmann CLA 2011-10-07 07:18:11 EDT
Build Identifier: 20110916-0149

After save, stereotype applications are lost on association member ends for associations that connect classes originating from different models (connected via package import).

Please see Steps to Reproduce as well as the attached JUnit Plugin Test.

Reproducible: Always

Steps to Reproduce:
1. Create a UML model with a class and save the model
2. Create another UML model with another class
3. Import model-1 in model-2
4. Associate the class of model-2 with the class of model-1
5. Apply any stereotype to the member ends of the association
6. Save model-2
7. Reload model-2
8. The stereotypes on the member ends of the association are now missing
Comment 1 Alexander Weickmann CLA 2011-10-07 07:19:56 EDT
Created attachment 204739 [details]
JUnit Plugin Test Case
Comment 2 Kenn Hussey CLA 2012-06-21 12:26:53 EDT
I just tried this interactively with the UML editor and it worked as expected (correctly).

Taking a look at your test case code, I see at least two problems:

1. You are creating more than one resource set; in order to properly create relations between two resources they must belong to the same resource set.

2. You are only saving model-2 after applying the stereotypes, whereas you must save both models because each of the navigable member ends of the association (which belong to classes in different resources) have been modified.

Please feel free reopen this bug if you still have problems once you've corrected your code.