Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354412 - containsAll returns wrong result in case of detached objects
Summary: containsAll returns wrong result in case of detached objects
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 12:46 EDT by Eike Stepper CLA
Modified: 2012-09-21 06:52 EDT (History)
0 users

See Also:


Attachments
Fix (9.65 KB, patch)
2011-08-10 14:55 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.