Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339495 - CDOTransactionImpl.formerRevisionKeys is superfluous
Summary: CDOTransactionImpl.formerRevisionKeys is superfluous
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 06:07 EST by Caspar D. CLA
Modified: 2011-06-23 03:37 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Patch v1 (8.33 KB, text/plain)
2011-03-10 06:15 EST, Caspar D. CLA
no flags Details
Patch v2 (9.81 KB, patch)
2011-03-10 06:31 EST, Caspar D. CLA
no flags Details | Diff
Patch v3 (9.74 KB, patch)
2011-03-15 04:09 EDT, Caspar D. 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 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