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

Bug 354412

Summary: containsAll returns wrong result in case of detached objects
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Eike Stepper CLA 2011-08-10 12:46:15 EDT
Cloned from: 354395: containsAll returns wrong result in case of detached objects
https://bugs.eclipse.org/bugs/show_bug.cgi?id=354395

Build Identifier:  20110615-0604

[17:20:17 | Bearbeitet 17:20:27] Bernd: If an ereference feature contains a detached object (e.g. if a contained object was removed from its containment relationship), then the call of containsAll() will return false instead of true. I attached a junit test which demonstrates this problem. I also see this problem with contains(), but I was not able to reproduce this in an unit-test. 
I think the problem could be in org.eclipse.emf.internal.cdo.view.CDOStoreImpl.contains() where the CDOID of the object will be used for check the containment in the CDORevision values, but in the case of a detached object, the objected itself will be hold in the CDORevision not only its id.

Reproducible: Always

Steps to Reproduce:
1. see unit-test
2.
3.
Comment 1 Eike Stepper CLA 2011-08-10 14:55:09 EDT
Created attachment 201270 [details]
Fix
Comment 2 Eike Stepper CLA 2011-08-10 14:55:24 EDT
Committed revision 8896:
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.common
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.tests
Comment 3 Eike Stepper CLA 2011-08-10 14:55:37 EDT
Resolved
Comment 4 Eike Stepper CLA 2012-09-21 06:52:03 EDT
Closing.