Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-09-26 09:47:00 +0000
committerCamille Letavernier2014-09-26 09:47:00 +0000
commitd507a74e442ebc61566d094ef2ab593eda718aad (patch)
treed2f7883b05706384c90088515c0304007eb3238a /plugins/infra
parente7ae2bf02bb342085585d34af59dc69220e2db77 (diff)
downloadorg.eclipse.papyrus-d507a74e442ebc61566d094ef2ab593eda718aad.tar.gz
org.eclipse.papyrus-d507a74e442ebc61566d094ef2ab593eda718aad.tar.xz
org.eclipse.papyrus-d507a74e442ebc61566d094ef2ab593eda718aad.zip
445111: [Model Import] Refactor->Switch Libraries causes side-effects
which means stereotypes get dropped from models https://bugs.eclipse.org/bugs/show_bug.cgi?id=445111 - Prevent modification of derived properties to avoid side-effects
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java
index 9804a314025..2bd33a691c0 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java
@@ -133,11 +133,14 @@ public class DependencyManagementHelper {
EObject eObject = allContentsIterator.next();
for (EReference reference : eObject.eClass().getEAllReferences()) {
- if (reference.isContainment()) {
+ if (reference.isContainer() || reference.isContainment()) {
continue;
}
- if (!reference.isChangeable()) {
+ // Attempts to modify a changeable + derived feature (e.g. Class#general in UML)
+ // will rely in reverse-derivation algorithms, which may recreate some existing elements
+ // (Instead of modifying them). This can result in loss of information. Don't change derived values.
+ if (reference.isDerived() || !reference.isChangeable()) {
continue;
}

Back to the top