Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-06-25 13:26:48 +0000
committerAnsgar Radermacher2014-06-25 13:27:23 +0000
commit159e3a310ad0f8162886bdffdc7655d74be27c20 (patch)
tree5a0032275d5ffb88074abc78bd2bb9db30a07264 /extraplugins/qompass-designer
parent1dd2d67d16eb21b346835f40fe90003799556af4 (diff)
downloadorg.eclipse.papyrus-159e3a310ad0f8162886bdffdc7655d74be27c20.tar.gz
org.eclipse.papyrus-159e3a310ad0f8162886bdffdc7655d74be27c20.tar.xz
org.eclipse.papyrus-159e3a310ad0f8162886bdffdc7655d74be27c20.zip
438151 - [QDesigner] Dangling HREF in producer/consumer example
Diffstat (limited to 'extraplugins/qompass-designer')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompImplTrafos.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompImplTrafos.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompImplTrafos.java
index 77f44c5219f..725cd238391 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompImplTrafos.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompImplTrafos.java
@@ -15,7 +15,6 @@
package org.eclipse.papyrus.qompass.designer.core.transformations;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.emf.common.util.BasicEList;
@@ -45,6 +44,7 @@ import org.eclipse.uml2.uml.Parameter;
import org.eclipse.uml2.uml.Port;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.StructuralFeature;
+import org.eclipse.uml2.uml.StructuredClassifier;
import org.eclipse.uml2.uml.Type;
import org.eclipse.uml2.uml.UMLPackage;
@@ -561,16 +561,21 @@ public class CompImplTrafos {
return ""; //$NON-NLS-1$
}
+ /**
+ * Recursively delete all connectors in a given package package
+ * @param pkg the package in which connector deletion starts
+ */
public static void deleteConnectors(Package pkg) {
- Iterator<PackageableElement> elements = pkg.getPackagedElements()
- .iterator();
- while (elements.hasNext()) {
- PackageableElement element = elements.next();
+ for (PackageableElement element : pkg.getPackagedElements()) {
if (element instanceof Package) {
deleteConnectors((Package) element);
- } else if (element instanceof Class) {
- Class implementation = (Class) element;
- implementation.getOwnedConnectors().clear();
+ } else if (element instanceof StructuredClassifier) {
+ StructuredClassifier sc = (StructuredClassifier) element;
+ EList<Connector> connectors = new BasicEList<Connector>();
+ connectors.addAll(sc.getOwnedConnectors());
+ for (Connector connector : connectors) {
+ connector.destroy();
+ }
}
}
}

Back to the top