Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2016-12-30 10:20:16 +0000
committerPierre-Charles David2017-02-01 15:53:47 +0000
commitab5a1ccf93c3200b69cc4cc61b349383ae5e75b8 (patch)
tree42c8d8e55526ef122c5821ea6e4c1bc0eabed3b9
parent7818c61add5b70d00fb7afb177300db8b7b3615c (diff)
downloadorg.eclipse.sirius-ab5a1ccf93c3200b69cc4cc61b349383ae5e75b8.tar.gz
org.eclipse.sirius-ab5a1ccf93c3200b69cc4cc61b349383ae5e75b8.tar.xz
org.eclipse.sirius-ab5a1ccf93c3200b69cc4cc61b349383ae5e75b8.zip
[509588] Fix potential CME during container drop operations
Bug: 509588 Change-Id: Ic61ca8bf91646bf793cec22808e91211c24b9f96 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java
index c3f6abc36b..ded86de12b 100644
--- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java
+++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2017 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,7 +16,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.sirius.business.api.helper.SiriusUtil;
import org.eclipse.sirius.business.api.helper.task.AbstractCommandTask;
@@ -63,6 +62,8 @@ import org.eclipse.sirius.viewpoint.description.SemanticBasedDecoration;
import org.eclipse.sirius.viewpoint.description.tool.DragSource;
import org.eclipse.sirius.viewpoint.description.tool.ToolPackage;
+import com.google.common.collect.Lists;
+
/**
* Common operations for DnD tasks.
*
@@ -294,8 +295,7 @@ public final class DnDTasksOperations {
*/
static void moveSubNodes(final DNodeContainer oldDiagramElementContainer, final EObject containerDroppedElement, final ContainerDropDescription tool,
final DNodeContainer newDiagramElementContainer) {
- final EList<DDiagramElement> ownedDiagramElementsToDrop = oldDiagramElementContainer.getOwnedDiagramElements();
- for (DDiagramElement diagramElementToDrop : ownedDiagramElementsToDrop) {
+ for (DDiagramElement diagramElementToDrop : Lists.newArrayList(oldDiagramElementContainer.getOwnedDiagramElements())) {
final DragAndDropTargetDescription dragDragAndDropDescription = newDiagramElementContainer.getDragAndDropDescription();
final ContainerDropDescription dropTool = DDiagramElementContainerSpecOperations.getBestDropDescription(dragDragAndDropDescription, diagramElementToDrop.getTarget(),
containerDroppedElement, containerDroppedElement, newDiagramElementContainer, DragSource.DIAGRAM_LITERAL, diagramElementToDrop);

Back to the top