Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318844 - CDONotificationBuilder cannot handle mixed OID's/CDOObjects when processing CDOClearFeatureDelta
Summary: CDONotificationBuilder cannot handle mixed OID's/CDOObjects when processing C...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 04:46 EDT by Caspar D. CLA
Modified: 2012-09-21 06:50 EDT (History)
1 user (show)

See Also:


Attachments
Testcase (as a patch) (4.28 KB, patch)
2010-07-05 04:59 EDT, Caspar D. CLA
no flags Details | Diff
Fix and Test v1 (6.12 KB, patch)
2010-07-05 05:13 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 Caspar D. CLA 2010-07-05 04:46:21 EDT
Code assumes that list consists either of CDOID's only, or
of CDOObjects only. But the list content can in fact be mixed.
When it is, a ClassCastException gets thrown because the
subsequent iteration over the list's contents assumes all
elements are CDOID's.

Offending code is in CDONotificationBuilder.java, lines 180 ff.
Comment 1 Caspar D. CLA 2010-07-05 04:59:23 EDT
Created attachment 173394 [details]
Testcase (as a patch)

Testcase demonstrates how the problem can occur during refresh,
if the list being clear locally had a new element that had not 
been committed yet.
Comment 2 Eike Stepper CLA 2010-07-05 05:00:12 EDT
I have a fix in mind...
Comment 3 Caspar D. CLA 2010-07-05 05:10:03 EDT
I'm thinking there may be a deeper problem here. It seems a
CDOClearFeatureDelta is generated if the incoming update removes
all *persisted* elements of the list. So the mistake, as I see it,
is that the delta is generated from a comparison between the new
revision (from the server) and the revision that was originally
viewed in the client -- but actually it should be between the 
new revision and the lists's *current* value (which may contain
new, unpersisted elements).
Comment 4 Eike Stepper CLA 2010-07-05 05:13:50 EDT
Created attachment 173397 [details]
Fix and Test v1
Comment 5 Eike Stepper CLA 2010-07-05 05:25:34 EDT
Committed to R3_0_maintenance
Comment 6 Eike Stepper CLA 2011-06-23 04:27:20 EDT
Moving all open problem reports to 4.0
Comment 7 Eike Stepper CLA 2012-09-21 06:36:54 EDT
Undoing accidental version change.
Comment 8 Eike Stepper CLA 2012-09-21 06:50:49 EDT
Closing.