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

Bug 315942

Summary: EClass.getEAllContainments does not get refreshed when the containment of a reference is changed.
Product: [Modeling] EMF Reporter: Markus Herrmannsdoerfer <herrmama>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Herrmannsdoerfer CLA 2010-06-07 05:09:05 EDT
When the containment of a reference is changed, the cache behind the method EClass.getEAllContainments does not get refreshed. More specifically, the last assertion of the following minimal test case fails:


EClass eClass = EcoreFactory.eINSTANCE.createEClass();

Assert.assertTrue(eClass.getEAllContainments().isEmpty());

EReference reference = EcoreFactory.eINSTANCE.createEReference();
reference.setContainment(true);
eClass.getEStructuralFeatures().add(reference);

Assert.assertEquals(1, eClass.getEAllContainments().size());

reference.setContainment(false);

Assert.assertTrue(eClass.getEAllContainments().isEmpty());
Comment 1 Ed Merks CLA 2010-09-07 21:56:43 EDT
A fix has been committed to CVS for 2.7.
Comment 2 Ed Merks CLA 2010-11-05 05:41:33 EDT
The fix is available in the latest build for the stream.