Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Commit

Permalink
Removing dependency to apache collections
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Eder committed Nov 30, 2018
1 parent 3aa8b7b commit 024b096
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions bundles/specmate-testspecification/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -546,15 +545,19 @@ private void pushMutualExclusiveConstraints(GateTranslator translator) throws Co

private Collection<Collection<CEGNode>> getMutualExclusiveNodeSets() {
Collection<Collection<CEGNode>> result = new ArrayList<>();
MultiValueMap<String, CEGNode> multiMap = new MultiValueMap<String, CEGNode>();
Map<String, Set<CEGNode>> multiMap = new HashMap<String, Set<CEGNode>>();
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<CEGNode>());
}
multiMap.get(variable).add(cegNode);
}
}
for (String key : multiMap.keySet()) {
result.add(multiMap.getCollection(key));
result.add(multiMap.get(key));
}
return result;
}
Expand Down

0 comments on commit 024b096

Please sign in to comment.