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

Bug 314255

Summary: [Class Diagram] Containment Cycling Model with the Class Diagram
Product: [Modeling] Papyrus Reporter: Cedric Brun <cedric.brun>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: 0.7.0   
Hardware: PC   
OS: All   
Whiteboard:

Description Cedric Brun CLA 2010-05-25 08:39:35 EDT
1. create a new class diagram
2. click on "nodes"=>"Class" and create a class
3. click on "edges"=>"Containment link" and click on the previously created class

Eclipse become unusable, errors are poping up on every action and the error log is filled with Exceptions caused by :

Caused by: java.lang.IllegalStateException: There is a cycle in the containment hierarchy of org.eclipse.uml2.uml.internal.impl.ClassImpl@1cc858 (name: Class0, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)
at org.eclipse.emf.ecore.util.EcoreUtil.getRootContainer(EcoreUtil.java:811)
at org.eclipse.uml2.common.util.CacheAdapter.addAdapter(CacheAdapter.java:282)
at org.eclipse.uml2.common.util.CacheAdapter.getNonNavigableInverseReferences(CacheAdapter.java:298)
at org.eclipse.uml2.common.util.UML2Util.getNonNavigableInverseReferences(UML2Util.java:1104)

Looks like after this sequence of actions the model is cycling in its containment structure.
Comment 1 Yann Tanguy CLA 2010-06-10 17:02:00 EDT
Containment link must have different element ends

If A contains B, ContainmentLink creation from B to A does not modify containment (the result should be B contains A after ContainmentLink creation).
Comment 2 Yann Tanguy CLA 2010-06-25 11:05:12 EDT
Several bug are open related to the ContainmentLink behavior -> see Bug318000

*** This bug has been marked as a duplicate of bug 318000 ***