Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2017-09-27 21:31:50 +0000
committerLaurent Goubet2018-05-01 13:04:41 +0000
commit0b4b26610f1cd9174f8a0e754c2a0715aaa3206e (patch)
treeee6639114f5afd8465bcbabab7bcc44d238ec829
parentf7f103b5f83a96e9286adb4309631a31c4933701 (diff)
downloadorg.eclipse.emf.compare-0b4b26610f1cd9174f8a0e754c2a0715aaa3206e.tar.gz
org.eclipse.emf.compare-0b4b26610f1cd9174f8a0e754c2a0715aaa3206e.tar.xz
org.eclipse.emf.compare-0b4b26610f1cd9174f8a0e754c2a0715aaa3206e.zip
[525286] [Papyrus] Diffs in invisible stereotype property visualizations not filtered out by default
Pre-requisite for fixing the presentation of diffs for invisible stereotype property visualizations. The diagram change factory erroneously thinks that a notation view that has its semantic element explicitly set to null inherits the semantic, which it does not. The applied-stereotype comment views in Papyrus diagrams have explicit null elements, so without this fix, diffs for them are assigned instead to the diagram itself, which (a) doesn't make sense and (b) breaks the filtering to be implemented subsequently. Bug: 525286 Change-Id: I20493be6a44595e4ca332aeaa786cc012ad3dbd8 Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramChangeFactory.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramChangeFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramChangeFactory.java
index 3cbe58ae7..adf3d20c9 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramChangeFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramChangeFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2015 Obeo.
+ * Copyright (c) 2013, 2017 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Obeo - initial API and implementation
+ * Christian W. Damus - bug 525286
*******************************************************************************/
package org.eclipse.emf.compare.diagram.internal.factories;
@@ -147,8 +148,12 @@ public abstract class AbstractDiagramChangeFactory extends AbstractChangeFactory
if (result == null) {
result = match.getRight();
}
- if (!(result instanceof View
- && ReferenceUtil.safeEGet(result, NotationPackage.Literals.VIEW__ELEMENT) != null)
+
+ // Be careful: a view can have the element explicitly set to null, which means that
+ // it is a free-standing shape. This happens, for example, with GeoShapes and
+ // certain views in Papyrus diagrams (such as applied-stereotype comments). These
+ // explicitly nulls do not indicate inheritance of semantic element from the parent
+ if (!(result instanceof View && result.eIsSet(NotationPackage.Literals.VIEW__ELEMENT))
&& match.eContainer() instanceof Match) {
result = getViewContainer((Match)match.eContainer());
}

Back to the top