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

Bug 339495

Summary: CDOTransactionImpl.formerRevisionKeys is superfluous
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: cdo.coreAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: saulius.tvarijonas
Version: 4.0Flags: stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch v1
none
Patch v2
none
Patch v3 none

Description Caspar D. CLA 2011-03-10 06:07:35 EST
As Egidijus pointed out to me, the same info can be obtained from
CDOTransactionImpl.cleanRevisions.
Comment 1 Caspar D. CLA 2011-03-10 06:15:38 EST
Created attachment 190842 [details]
Patch v1

All tests pass, but this needs a closer look. The convenience of
formerRevisionKeys was that the detached InternalCDOObject was the
key; and so this map was a fast way of checking whether an object
had been detached.

Without the map, so far the only way that I can think of, of checking
this, is getDetachedObjects().containsValue(obj). That works, but
it's not efficient.
Comment 2 Caspar D. CLA 2011-03-10 06:31:45 EST
Created attachment 190843 [details]
Patch v2
Comment 3 Caspar D. CLA 2011-03-10 06:33:32 EST
The performance of the lookup is only an issue in 
CDOTransactionImpl.getID(InternalCDOObject,boolean).

I'm not sure what to do about it without re-introducing
an indexable collection of detached objects.
Comment 4 Eike Stepper CLA 2011-03-15 03:36:33 EDT
Given, the changes in the else branch of CDOTransactionImpl.cleanUp(CDOCommitContext), I wonder if this bugzilla is "just" an enhancement...
Comment 5 Caspar D. CLA 2011-03-15 04:09:23 EDT
Created attachment 191193 [details]
Patch v3
Comment 6 Eike Stepper CLA 2011-03-15 06:18:23 EDT
Committed revision 7535:
- trunk/plugins/org.eclipse.emf.cdo
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 7 Eike Stepper CLA 2011-03-15 06:18:47 EDT
Resolving for Caspar...
Comment 8 Eike Stepper CLA 2011-06-23 03:37:43 EDT
Available in R20110608-1407