diff options
| author | Steve Monnier | 2019-04-26 12:35:02 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2019-05-27 15:27:33 +0000 |
| commit | 3a12bac006c3645a13f4313af2ce2d63c7034e53 (patch) | |
| tree | 90c35fe154ec88f799f78c1e280c753f61aa90f7 | |
| parent | 1a77724cbd9f1d31fd16a134763de5a6dcac11b8 (diff) | |
| download | org.eclipse.sirius-3a12bac006c3645a13f4313af2ce2d63c7034e53.tar.gz org.eclipse.sirius-3a12bac006c3645a13f4313af2ce2d63c7034e53.tar.xz org.eclipse.sirius-3a12bac006c3645a13f4313af2ce2d63c7034e53.zip | |
[547699] Remove Sets calls to avoid Guava dependency on the server-side
Removal of the use of Sets in getAllNodeMappings and
getAllContainerMappings methods to avoid having a dependency to
com.google.guava when loading VSMs outside of OSGi.
Bug: 547699
Change-Id: I072e30d5da5d500896eb6514281da064875d4aca
Cherry-picks: I760053788d4960c85c0efd6b12b8f13f3c79e020
Signed-off-by: Steve Monnier <steve.monnier@obeo.fr>
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/metamodel/helper/ContainerMappingHelper.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java index f50db3f8c0..a8dfd1272f 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2019 THALES GLOBAL SERVICES. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.business.internal.metamodel.helper; import java.util.Collection; +import java.util.LinkedHashSet; import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; @@ -20,8 +21,6 @@ import org.eclipse.sirius.diagram.description.ContainerMapping; import org.eclipse.sirius.diagram.description.DiagramElementMapping; import org.eclipse.sirius.diagram.description.NodeMapping; -import com.google.common.collect.Sets; - /** * Utility class to factor customizations for ContainerMapping and related. * @@ -41,7 +40,9 @@ public final class ContainerMappingHelper { * @return the node mappings. */ public static Collection<NodeMapping> getAllNodeMappings(ContainerMapping self) { - return Sets.union(Sets.newLinkedHashSet(self.getSubNodeMappings()), Sets.newLinkedHashSet(self.getReusedNodeMappings())); + LinkedHashSet<NodeMapping> allNodeMappings = new LinkedHashSet<NodeMapping>(self.getSubNodeMappings()); + allNodeMappings.addAll(new LinkedHashSet<NodeMapping>(self.getReusedNodeMappings())); + return allNodeMappings; } /** @@ -53,7 +54,9 @@ public final class ContainerMappingHelper { * @return the container mappings. */ public static Collection<ContainerMapping> getAllContainerMappings(ContainerMapping self) { - return Sets.union(Sets.newLinkedHashSet(self.getSubContainerMappings()), Sets.newLinkedHashSet(self.getReusedContainerMappings())); + LinkedHashSet<ContainerMapping> allContainerMappings = new LinkedHashSet<ContainerMapping>(self.getSubContainerMappings()); + allContainerMappings.addAll(new LinkedHashSet<ContainerMapping>(self.getReusedContainerMappings())); + return allContainerMappings; } /** |
