From 4960564f8746b3accd11a2b3faded9f1a57a0b29 Mon Sep 17 00:00:00 2001
From: Florian Hoelzl <hoelzl@fortiss.org>
Date: Fri, 30 Dec 2011 15:59:44 +0000
Subject: [PATCH] fixed delete refs 351

---
 .../compose/ConnectorConnectionCompositorBase.java | 14 +-------------
 .../HierarchicElementConnectionCompositorBase.java | 11 +----------
 .../decompose/HierarchicElementCompositorBase.java |  8 ++++----
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/ConnectorConnectionCompositorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/ConnectorConnectionCompositorBase.java
index 996ce8073..0a8da42ef 100644
--- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/ConnectorConnectionCompositorBase.java
+++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/ConnectorConnectionCompositorBase.java
@@ -23,16 +23,13 @@ import org.fortiss.tooling.base.model.base.ConnectorBase;
 import org.fortiss.tooling.base.model.base.EntryConnectorBase;
 import org.fortiss.tooling.base.model.base.ExitConnectorBase;
 import org.fortiss.tooling.base.model.base.HierarchicElementBase;
-import org.fortiss.tooling.base.model.element.IConnection;
 import org.fortiss.tooling.base.model.element.IConnector;
 import org.fortiss.tooling.base.model.element.IHierarchicElement;
-import org.fortiss.tooling.base.model.element.IModelElementSpecification;
 import org.fortiss.tooling.base.ui.dnd.gef.ConnectionDragContext;
 import org.fortiss.tooling.base.ui.editpart.FreeConnectorEditPartBase;
 import org.fortiss.tooling.kernel.extension.IConnectionCompositor;
 import org.fortiss.tooling.kernel.extension.data.IConnectionCompositionContext;
 import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
-import org.fortiss.tooling.kernel.service.IElementCompositorService;
 import org.fortiss.tooling.kernel.service.IPersistencyService;
 
 /**
@@ -41,7 +38,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: C94499EC031FDED2F6E2486CBE372771
+ * @ConQAT.Rating YELLOW Hash: BF580E0E9288B911232B85705FA1BA19
  */
 public abstract class ConnectorConnectionCompositorBase<HE extends IHierarchicElement, S extends IConnector, T extends IConnector>
 		implements IConnectionCompositor<HE, S, T> {
@@ -255,15 +252,6 @@ public abstract class ConnectorConnectionCompositorBase<HE extends IHierarchicEl
 		if (!canDisconnectSpecific(connection)) {
 			return false;
 		}
-		if (connection instanceof IConnection) {
-			IConnection conn = (IConnection) connection;
-			for (IModelElementSpecification spec : conn.getSpecificationsList()) {
-				if (!IElementCompositorService.INSTANCE.canDecompose(spec)) {
-					return false;
-				}
-			}
-		}
-
 		return true;
 	}
 
diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/HierarchicElementConnectionCompositorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/HierarchicElementConnectionCompositorBase.java
index 7aff0b645..9ad8ce8a8 100644
--- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/HierarchicElementConnectionCompositorBase.java
+++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/compose/HierarchicElementConnectionCompositorBase.java
@@ -22,7 +22,6 @@ import org.eclipse.gef.RootEditPart;
 import org.fortiss.tooling.base.model.element.IConnection;
 import org.fortiss.tooling.base.model.element.IConnector;
 import org.fortiss.tooling.base.model.element.IHierarchicElement;
-import org.fortiss.tooling.base.model.element.IModelElementSpecification;
 import org.fortiss.tooling.base.ui.dnd.gef.ConnectionDragContext;
 import org.fortiss.tooling.base.ui.dnd.gef.ElementDropContext;
 import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
@@ -56,7 +55,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 04720A8197A9EB98DDAC140197C8A2A9
+ * @ConQAT.Rating YELLOW Hash: 3285EEEA692650AD1130A074EE3F75F8
  */
 public abstract class HierarchicElementConnectionCompositorBase<HE extends IHierarchicElement, S extends IHierarchicElement, T extends IHierarchicElement>
 		implements IConnectionCompositor<HE, S, T> {
@@ -147,14 +146,6 @@ public abstract class HierarchicElementConnectionCompositorBase<HE extends IHier
 	/** {@inheritDoc} */
 	@Override
 	public boolean canDisconnect(EObject connection) {
-		if (connection instanceof IConnection) {
-			IConnection conn = (IConnection) connection;
-			for (IModelElementSpecification spec : conn.getSpecificationsList()) {
-				if (!IElementCompositorService.INSTANCE.canDecompose(spec)) {
-					return false;
-				}
-			}
-		}
 		return true;
 	}
 
diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/decompose/HierarchicElementCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/decompose/HierarchicElementCompositorBase.java
index 266de2512..78e109404 100644
--- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/decompose/HierarchicElementCompositorBase.java
+++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/decompose/HierarchicElementCompositorBase.java
@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
  * @author doebber
  * @author $Author: hoelzl $
  * @version $Rev: 18709 $
- * @ConQAT.Rating YELLOW Hash: 0C8A1BCCA3B14C572278D536050034C5
+ * @ConQAT.Rating YELLOW Hash: E5DA3C13BF3E5399E425B401D62C0579
  */
 public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElementContainer>
 		implements IElementCompositor<HE> {
@@ -164,14 +164,14 @@ public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElem
 	}
 
 	/**
-	 * Base implementation returns compositors' decomposition by default and
-	 * invokes EcoreUtil.delete() otherwise. Subclasses may override.
+	 * Base implementation uses element compositor service's decomposition by
+	 * default and returns <code>true</code>. Subclasses may override.
 	 */
 	protected boolean decomposeSpecification(IModelElementSpecification element) {
 		if (IElementCompositorService.INSTANCE.canDecompose(element)) {
 			return IElementCompositorService.INSTANCE.decompose(element);
 		}
-		EcoreUtil.delete(element);
+		// no delete here, since normally specs are destroyed with the element
 		return true;
 	}
 
-- 
GitLab