Skip to content

Commit f6c7b0d

Browse files
committed
Increment the index after the element was added to the list
Currently elements are merged in reverse order if an insert index is give because the add is always performed at the original index. This now do the following: - on each insert operation the index is incremented if given - if the index is larger than the list size the element is added instead.
1 parent 328646d commit f6c7b0d

File tree

1 file changed

+6
-1
lines changed
  • bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal

1 file changed

+6
-1
lines changed

bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal/ModelUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,12 @@ private static void mergeList(List<MApplicationElement> list, List<MApplicationE
197197
if (index == -1) {
198198
list.add(element);
199199
} else {
200-
list.add(index, element);
200+
if (index > list.size()) {
201+
list.add(element);
202+
} else {
203+
list.add(index, element);
204+
}
205+
index++;
201206
}
202207
}
203208
}

0 commit comments

Comments
 (0)