Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349526 - CommitIntegrityCheck should use #equals when comparing OIDs
Summary: CommitIntegrityCheck should use #equals when comparing OIDs
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 04:02 EDT by Caspar D. CLA
Modified: 2012-09-21 07:16 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Patch v1 (1.19 KB, patch)
2011-06-16 04:06 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-06-16 04:02:30 EDT
Currently there's some logic in CommitIntegrityCheck that 
compares CDOIDs by identity. This will usually work, but not
always. Should use CDOIDUtil.equals instead.
Comment 1 Caspar D. CLA 2011-06-16 04:03:15 EDT
[NoMagic note: SVR-3205]
Comment 2 Caspar D. CLA 2011-06-16 04:06:04 EDT
Created attachment 198069 [details]
Patch v1
Comment 3 Eike Stepper CLA 2011-07-02 04:37:46 EDT
Changing to 4.1 to ensure that the fix will "last". Please clone this bugzilla to 4.0 if you want a maintenance fix, too.
Comment 4 Eike Stepper CLA 2011-07-02 04:39:58 EDT
The patch looks okay. But I also still see code like this: if (currentContainerID != CDOID.NULL)

It'd be safer to use CDOIDUtil.isNull(id) instead. Please feel free to chnage thos plcaes, too, before you commit to *trunk* !
Comment 5 Caspar D. CLA 2011-07-04 00:47:43 EDT
Committed revision 8577 to trunk.
Comment 6 Caspar D. CLA 2011-07-04 01:14:09 EDT
Resolving to FIXED.
Comment 7 Caspar D. CLA 2011-07-04 01:42:00 EDT
Cloned as bug 351042
Comment 8 Eike Stepper CLA 2011-07-04 03:43:06 EDT
I can still see checks like "currentContainerID != CDOID.NULL" and from the context I can not see that currentContainerID!=null. Don't you think it's worth fixing that to "!CDOIDUtil.isNull(currentContainerID)"?
Comment 9 Eike Stepper CLA 2012-09-21 07:16:53 EDT
Closing.