| Summary: | CommitIntegrityCheck does not check inclusion of normal refTargets in NEW state | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Caspar D. <caspar_d> | ||||||||
| Component: | cdo.core | Assignee: | Caspar D. <caspar_d> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | saulius.tvarijonas | ||||||||
| Version: | 4.0 | Flags: | stepper:
review+
stepper: review+ stepper: review+ |
||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Caspar D.
Created attachment 190350 [details]
Patch (including testcase)
Note that I've also sneaked in a minor improvement in the partial commit API. I'm changing the committables set from Set<EObject> to Set<? extends EObject>. I should have done it that way from the start, methinks. Committed revision 7425. Patch introduces a bug: CommitIntegrityCheck.checkFeatureDelta will throw an exception at the bottom of the method, if containmentOrWithOpposite==false and the delta is not one either CDOSetFeatureDelta or CDOAddFeatureDelta. Created attachment 190813 [details]
Patch (incremental)
For your reviewing convenience: it looks like a big change in the diff view, but it's not. I simply replaced the recurring else if (containmentOrWithOpposite && ...) condition with a single if (containmentOrWithOpposite) enclosing all relevant branches. Committed revision 7436. Still not working perfectly. The remaining problem (or rather: "one known remaining problem") is that normal (non-bidi) refTargets of NEW objects that *are* included, are not checked. This is a problem if those targets themselves are NEW, and its a containment reference. In those cases, those targets must be included in the commit, but currently the CommitIntegrityCheck doesn't detect the problem. Created attachment 193678 [details]
Patch (incremental, including testcase)
(In reply to comment #8) > This is a problem if those targets themselves are NEW, and its > a containment reference. No no no Caspar, don't be silly!! Whether the ref is containment or not doesn't matter; even if it's non-containment, the target must be committed otherwise it'll be a dangling reference. I see you got it right in the patch though. ;-) Committed revision 7635. Available in R20110608-1407 |