Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkhussey2007-06-12 21:01:06 +0000
committerkhussey2007-06-12 21:01:06 +0000
commit8ef26851a6a8f36adc018fe8c610b05a355cd85d (patch)
treed4eb226755df0af02224e48b2459e7fe44e6767b
parent2b22610635a11db4cd46d88e994590d132030d61 (diff)
downloadorg.eclipse.uml2-8ef26851a6a8f36adc018fe8c610b05a355cd85d.tar.gz
org.eclipse.uml2-8ef26851a6a8f36adc018fe8c610b05a355cd85d.tar.xz
org.eclipse.uml2-8ef26851a6a8f36adc018fe8c610b05a355cd85d.zip
[192262] Avoiding automatic (un)application of stereotypes when an element's container is set to a change description.
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/impl/ElementImpl.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/impl/ElementImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/impl/ElementImpl.java
index 5be0d1c11..c46080443 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/impl/ElementImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/impl/ElementImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ElementImpl.java,v 1.39 2007/04/25 17:47:03 khussey Exp $
+ * $Id: ElementImpl.java,v 1.40 2007/06/12 21:01:06 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.impl;
@@ -16,6 +16,7 @@ import java.util.Collection;
import java.util.Map;
//import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.CommonPlugin;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -773,13 +774,32 @@ public abstract class ElementImpl
return basicGetOwner() != null;
}
+ private static final Class<?> CHANGE_DESCRIPTION_CLASS;
+
+ static {
+ Class<?> changeDescriptionClass = null;
+
+ try {
+ changeDescriptionClass = CommonPlugin.loadClass(
+ "org.eclipse.emf.ecore.change",
+ "org.eclipse.emf.ecore.change.ChangeDescription");
+ } catch (Throwable throwable) {
+ // ignore
+ }
+
+ CHANGE_DESCRIPTION_CLASS = changeDescriptionClass;
+ }
+
@Override
public NotificationChain eBasicSetContainer(InternalEObject newContainer,
int newContainerFeatureID, NotificationChain msgs) {
msgs = super.eBasicSetContainer(newContainer, newContainerFeatureID,
msgs);
- if (newContainer != null) {
+ if (newContainer != null
+ && (CHANGE_DESCRIPTION_CLASS == null || !(CHANGE_DESCRIPTION_CLASS
+ .isInstance(newContainer)))) {
+
Resource.Internal eInternalResource = eInternalResource();
if (eInternalResource == null || !eInternalResource.isLoading()) {

Back to the top