Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AttributeChangeMerger.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AttributeChangeMerger.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AttributeChangeMerger.java
index c7ac57d40..11c53cc4b 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AttributeChangeMerger.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AttributeChangeMerger.java
@@ -471,6 +471,13 @@ public class AttributeChangeMerger extends AbstractMerger {
// Then the index, in the target, at which this value needs to be moved
int insertionIndex = DiffUtil.findInsertionIndexForElementAt(comparison, sourceList, copyTarget, lcs,
currentIndexInSource);
+ /*
+ * However, it could still have been located "before" its new index, in which case we need to take it
+ * into account.
+ */
+ if (insertionIndex > currentIndexInTarget) {
+ insertionIndex--;
+ }
if (targetList instanceof EList<?>) {
if (insertionIndex < 0 || insertionIndex >= targetList.size()) {

Back to the top