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

Bug 323930

Summary: XRefExcluder does not use adjusted list indexes
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 CC: michael
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: offline-01
Attachments:
Description Flags
Patch - for future reference none

Description Eike Stepper CLA 2010-08-30 03:07:02 EDT
While ensuring referential integrity during commits the XRefExcluder is supposed to remove XRef candidates that are to be removed by the ongoing commit. For many-valued XRefs it does so by comparing the index of the XRef and RemoveFeatureDelta from the commit.

If the commit contains multiple feature deltas of type ListIndexAffecting this check may go wrong.
Comment 1 Eike Stepper CLA 2010-08-30 07:49:40 EDT
Aligning the incoming XRefs from the store accessor with the feature deltas of the ongoing commit is not only a hazzle (indexes would need to be adjusted). Rather it's not possible in all cases, as in the case of a REPLACE, i.e. a set(index, CDOID), because we can not deduce the old value from the delta.

Consequently I've removed the whole XRefExcluder (which used to do this alignment). Instead I've deferred the call to checkXRefs() until after computeDirtyObjects() has been called. This way the dirtyObjects can be used instead of the XRef data passed in from the store accessor.
Comment 2 Eike Stepper CLA 2010-08-30 07:50:09 EDT
Created attachment 177720 [details]
Patch - for future reference
Comment 3 Eike Stepper CLA 2010-08-30 07:53:18 EDT
Committed to HEAD
Comment 4 Eike Stepper CLA 2011-06-23 03:42:34 EDT
Available in R20110608-1407