From 024b096f50f002218a8802f803038b99fd5c6afd Mon Sep 17 00:00:00 2001 From: Sebastian Eder Date: Fri, 30 Nov 2018 08:44:59 +0100 Subject: [PATCH] Removing dependency to apache collections --- bundles/specmate-testspecification/bnd.bnd | 3 +-- .../internal/services/CEGTestCaseGenerator.java | 11 +++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bundles/specmate-testspecification/bnd.bnd b/bundles/specmate-testspecification/bnd.bnd index c69713168..fc5b2f92e 100644 --- a/bundles/specmate-testspecification/bnd.bnd +++ b/bundles/specmate-testspecification/bnd.bnd @@ -16,8 +16,7 @@ org.sat4j.maxsat,\ org.sat4j.pb,\ specmate-emfrest-api;version=latest,\ - specmate-rest;version=latest,\ - org.apache.commons.collections4 + specmate-rest;version=latest Private-Package: \ com.specmate.testspecification.internal.services,\ com.specmate.testspecification.internal.testskeleton \ No newline at end of file diff --git a/bundles/specmate-testspecification/src/com/specmate/testspecification/internal/services/CEGTestCaseGenerator.java b/bundles/specmate-testspecification/src/com/specmate/testspecification/internal/services/CEGTestCaseGenerator.java index 044800967..c17ba2766 100644 --- a/bundles/specmate-testspecification/src/com/specmate/testspecification/internal/services/CEGTestCaseGenerator.java +++ b/bundles/specmate-testspecification/src/com/specmate/testspecification/internal/services/CEGTestCaseGenerator.java @@ -11,7 +11,6 @@ import java.util.Optional; import java.util.Set; -import org.apache.commons.collections4.map.MultiValueMap; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.eclipse.emf.ecore.EObject; @@ -546,15 +545,19 @@ private void pushMutualExclusiveConstraints(GateTranslator translator) throws Co private Collection> getMutualExclusiveNodeSets() { Collection> result = new ArrayList<>(); - MultiValueMap multiMap = new MultiValueMap(); + Map> multiMap = new HashMap>(); for (IModelNode node : nodes) { CEGNode cegNode = (CEGNode) node; if (cegNode.getCondition().trim().startsWith("=")) { - multiMap.put(cegNode.getVariable(), cegNode); + String variable = cegNode.getVariable(); + if(!multiMap.containsKey(variable)) { + multiMap.put(variable, new HashSet()); + } + multiMap.get(variable).add(cegNode); } } for (String key : multiMap.keySet()) { - result.add(multiMap.getCollection(key)); + result.add(multiMap.get(key)); } return result; }