Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350027 - Fix index for moves from left to right
Summary: Fix index for moves from left to right
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 06:27 EDT by Cyril Jaquier CLA
Modified: 2012-09-21 07:16 EDT (History)
1 user (show)

See Also:


Attachments
Fix the index for moves from left to right (1.32 KB, patch)
2011-06-22 06:27 EDT, Cyril Jaquier CLA
no flags Details | Diff
Error Screenshot (8.36 KB, image/png)
2011-07-03 07:36 EDT, Eike Stepper CLA
no flags Details
Fix the index for moves from left to right (1.30 KB, patch)
2011-07-04 05:08 EDT, Cyril Jaquier CLA
no flags Details | Diff
Fix the index for moves from left to right (3.48 KB, patch)
2011-07-04 08:04 EDT, Cyril Jaquier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cyril Jaquier CLA 2011-06-22 06:27:22 EDT
Build Identifier: 4.0 GA

The index variable needs to be modified in adjustAfterRemoval() for moves from left to right (smaller index to a bigger one).

We have this patch in our CDO code but I am not sure if we have a test case for it.

Reproducible: Always
Comment 1 Cyril Jaquier CLA 2011-06-22 06:27:47 EDT
Created attachment 198383 [details]
Fix the index for moves from left to right
Comment 2 Eike Stepper CLA 2011-06-23 04:26:59 EDT
Moving all open problem reports to 4.0
Comment 3 Eike Stepper CLA 2011-07-03 07:35:06 EDT
I just wanted to study this patch but I could not apply it. For some reason I get the error message "org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java (file does not exist)". See the screenshot I'm about to attach.

But this file does exist. Can it be a problem with projects in non-default locations? Cyril, can you please try to create a new patch and this time set the Patch Root to Workspace on the second page?
Comment 4 Eike Stepper CLA 2011-07-03 07:36:53 EDT
Created attachment 199009 [details]
Error Screenshot
Comment 5 Cyril Jaquier CLA 2011-07-04 05:08:34 EDT
Created attachment 199032 [details]
Fix the index for moves from left to right
Comment 6 Cyril Jaquier CLA 2011-07-04 05:11:08 EDT
Hi Eike,

I just setup a new CDO workspace and I could apply my patch without problem!? I generated a new one using "Patch Root to Workspace". Give it a try ;-)
Comment 7 Cyril Jaquier CLA 2011-07-04 08:04:02 EDT
Created attachment 199043 [details]
Fix the index for moves from left to right
Comment 8 Cyril Jaquier CLA 2011-07-04 08:08:07 EDT
I added a basic test case. I didn't find a better one... I guess it should be possible to write something using org.eclipse.emf.spi.cdo.DefaultCDOMerger.PerFeature.ManyValued.handleListDelta() which calls adjustAfterRemoval() internally.

Pascal, do you remember a test case for this one!?
Comment 9 Eike Stepper CLA 2011-07-04 14:05:47 EDT
Hm, the problem with applying the patch probably came from a screwed up workspace. I spent a half day today with checking out new wqorkspaces and now it works. Anyway, it's always easier to apply workspace rooted patches ;-)

Your patch and the test look good to me. Pascal do you want to commit them or shall I?
Comment 10 Eike Stepper CLA 2011-07-04 14:11:27 EDT
All tests are passing. I'm going to commit the changes now...
Comment 11 Eike Stepper CLA 2011-07-04 14:11:50 EDT
Committed revision 8590:
- trunk/plugins/org.eclipse.emf.cdo.common
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 12 Eike Stepper CLA 2011-07-04 14:12:02 EDT
Committed revision 8590
Comment 13 Eike Stepper CLA 2012-09-21 07:16:02 EDT
Closing.