Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-02-17 14:45:31 -0500
committerChristian W. Damus2015-02-17 15:02:01 -0500
commit9d3d18039a0b9f4cdbe0f3465f9789d953a6c452 (patch)
treed8ef5e2b651cafce65e684117b2f7775e72f07a0
parentbc1be322ee5c1d01a37baf09c3c0a9e86241b79a (diff)
downloadorg.eclipse.papyrus-9d3d18039a0b9f4cdbe0f3465f9789d953a6c452.tar.gz
org.eclipse.papyrus-9d3d18039a0b9f4cdbe0f3465f9789d953a6c452.tar.xz
org.eclipse.papyrus-9d3d18039a0b9f4cdbe0f3465f9789d953a6c452.zip
Bug 459488: [Model Import] Stereotypes gone in fragmented model, one large activity diagram is missing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=459488 Ensure that in the case of the initial scanning of resources on opening the model, when resources are not yet traceable to their EditingDomain context, we infer editability based on the domain known to be associated with the snippet's ModelSet.
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java b/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java
index 99ffbb3e535..2d053ced47a 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java
@@ -30,6 +30,7 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.infra.core.resource.IModelSetSnippet;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
@@ -143,8 +144,14 @@ public class StereotypeApplicationRepairSnippet implements IModelSetSnippet {
ZombieStereotypesDescriptor result = null;
Element root = getRootUMLElement(resource);
+ EditingDomain domain = EMFHelper.resolveEditingDomain(root);
+ if ((domain == null) && (adapter != null)) {
+ // Assume our editing domain context
+ domain = ((ModelSet) adapter.getResourceSet()).getTransactionalEditingDomain();
+ }
+
// Only check for zombies in resources that we can modify (those being the resources in the user model opened in the editor)
- if ((root instanceof Element) && !EMFHelper.isReadOnly(resource, EMFHelper.resolveEditingDomain(root))) {
+ if ((root instanceof Element) && !EMFHelper.isReadOnly(resource, domain)) {
Element rootElement = root;
if (rootElement.getNearestPackage() != null) {
result = getZombieStereotypes(resource, rootElement);

Back to the top