Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315192 - [CompD] - Association between classes nested in component is doubled after creation
Summary: [CompD] - Association between classes nested in component is doubled after cr...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling
Classification: Modeling
Component: Samples (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Michael Golubev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 08:05 EDT by Christian Waniek CLA
Modified: 2012-12-11 15:12 EST (History)
2 users (show)

See Also:


Attachments
Picture of crashed diagram (29.33 KB, image/jpeg)
2010-06-01 11:53 EDT, Christian Waniek CLA
no flags Details
fixes the subj (12.93 KB, patch)
2010-06-04 12:49 EDT, Elena Shaverdova CLA
borlander: iplog+
borlander: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Waniek CLA 2010-06-01 08:05:20 EDT
Build Identifier: 

I get a nasty diagram when I try to create a reflexive association on a class, which is nested in a component (see atached screenshot).
In the diagram file occur TWO edge-definitions, but the model file correct, so when you close and reopen the diagram everything works fine.
But if you are shocked by the two associations and you want to remove them (or at least one of them), you'll get an entry in the eclipse error log and you can do nothing but close the diagram.

I haven't been able to get the problem source to provide a fix. Also I don't know whether this is a U2T bug or if it relates to GMF.

Reproducible: Always

Steps to Reproduce:
1. Create a Component
2. nest a Class c in the Component
3. crate an association from c to c
Comment 1 Michael Golubev CLA 2010-06-01 08:26:00 EDT
Mentioned screenshot would definitely help. 

severity -> normal, no formal reasons for major category.
Comment 2 Michael Golubev CLA 2010-06-01 09:02:06 EDT
Severity: back, normal -> major, user data loss, the whole diagram is broken

Steps to repeat: 
1. create component on CompD, 
2. create classed A, B inside the component 
3. draw association between A and B

=> 
there are 2 different associations between A and B shown at the diagram. 

4. select one of the associations and delete it
=> 
Nothing happens, exception in log. But now its impossible to reopen this diagram : any reopen attempt fails with: 

java.lang.ClassCastException: org.eclipse.uml2.uml.internal.impl.PackageImpl cannot be cast to org.eclipse.uml2.uml.Association
	at org.eclipse.uml2.diagram.component.edit.parts.AssociationEditPart.addSemanticListeners(AssociationEditPart.java:108)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.activate(ConnectionEditPart.java:253)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:196)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:152)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:193)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:152)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:193)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy.refreshOnActivate(CanonicalConnectionEditPolicy.java:106)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.activate(CanonicalEditPolicy.java:628)
	at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:165)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:148)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:193)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart.activate(DiagramEditPart.java:349)
	at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:201)
Comment 3 Christian Waniek CLA 2010-06-01 11:53:46 EDT
Created attachment 170651 [details]
Picture of crashed diagram
Comment 4 Elena Shaverdova CLA 2010-06-04 12:49:41 EDT
Created attachment 171127 [details]
fixes the subj
Comment 5 Michael Golubev CLA 2010-06-05 07:52:16 EDT
Comment on attachment 171127 [details]
fixes the subj

reviewed
Comment 6 Michael Golubev CLA 2010-06-05 08:10:45 EDT
Patch committed with minor changes. Fixed now