| Summary: | CommitException with XRef on new objects after branch merge | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Pascal Lehmann <pascal.lehmann> | ||||||
| Component: | cdo.core | Assignee: | Eike Stepper <stepper> | ||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | 4.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | offline-01 | ||||||||
| Attachments: |
|
||||||||
|
Description
Pascal Lehmann
Created attachment 177831 [details]
Testcase
Created attachment 177832 [details]
Proposed patch
I added a check of the newObjects list before adding the object to the lockTargets.
1) The number of lines that you changed is smaller than 250. confirmed. 2) You are the only author of these changed lines. confirmed. 3) You apply the EPL to these changed lines. confirmed. Good catch!
I've only changed it slightly in that the new check is done against a Set<CDOID> that is precalculated in lockObject():
if (ensuringReferentialIntegrity)
{
final Set<CDOID> newIDs = new HashSet<CDOID>();
for (int i = 0; i < newObjects.length; i++)
{
InternalCDORevision newRevision = newObjects[i];
CDOID newID = newRevision.getID();
if (newID instanceof CDOIDObject)
{
// After merges newObjects may contain non-TEMP ids
newIDs.add(newID);
}
}
Committed to HEAD Available in R20110608-1407 |