Bug 529253 - [Compare] Stereotype applications left behind by sub-unit refactoring merge

Rework the support for resource refactoring using an adapter
that marks a ResourceAttachmentChange as representing a
resource refactoring change, making its special semantics
explicit.  A merger for that specific diff takes care of the actual
refactoring.  An item-provider decorator customizes its
presentation in the UI to clearly show that it is a resource
refactoring and not just a root element moved to another
resource.

Change-Id: I0e75c58b0926de240507ddce25c773c9b24eb1d7
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/META-INF/MANIFEST.MF b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/META-INF/MANIFEST.MF
index 2581dba..36ea623 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/META-INF/MANIFEST.MF
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/META-INF/MANIFEST.MF
@@ -17,7 +17,8 @@
  org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.0.2",
  org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.2",
  org.eclipse.papyrus.uml.tools,
- org.eclipse.papyrus.compare.diagram.ide.ui
+ org.eclipse.papyrus.compare.diagram.ide.ui,
+ org.eclipse.papyrus.compare.uml2;bundle-version="[2.5.1,3.0.0)"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
 Import-Package: com.google.common.base;version="[15.0.0,22.0.0)",
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.properties b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.properties
index f5250ac..23643bd 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.properties
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.properties
@@ -1,5 +1,5 @@
 ################################################################################
-# Copyright (c) 2014 Obeo and others.
+# Copyright (c) 2014, 2018 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,7 +7,26 @@
 # 
 # Contributors:
 #     Obeo - initial API and implementation
+#     Christian W. Damus - bug 529253
 ################################################################################
 pluginName = EMF Compare Papyrus-specific UML2 support
 providerName = Eclipse Modeling Project
 
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+_UI_PropertyDescriptor_description = The {0} of the {1}
+_UI_Unknown_type = Object
+_UI_Unknown_datatype= Value
+_UI_Unknown_feature = Unspecified
+
+_UI_ResourceRefactoringChange_label = {0}
+_UI_ResourceRefactoringChange_detailLeft = \ [refactored from {0}]
+_UI_ResourceRefactoringChange_detailRight = \ [refactored as {0}]
+_UI_ResourceRefactoringChange_detail = \ [{0}]
+_UI_ResourceRefactoringChange_desc_actionLeft = refactored locally
+_UI_ResourceRefactoringChange_desc_actionRight = refactored remotely
+_UI_ResourceRefactoringChange_desc = The resource {0} has been {1} from {2} to {3}.
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.xml b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.xml
index f7a5792..da58e6a 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.xml
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/plugin.xml
@@ -20,5 +20,24 @@
             ranking="80"
             uri="http://www.eclipse.org/uml2/5.0.0/UML">
       </factory>
+      <factory
+            class="org.eclipse.papyrus.compare.uml2.edit.internal.decorator.PapyrusCompareItemProviderAdapterFactoryDecorator"
+            supportedTypes=
+              "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+               org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+               org.eclipse.emf.edit.provider.ITreeItemContentProvider
+               org.eclipse.emf.edit.provider.IItemLabelProvider
+               org.eclipse.emf.edit.provider.IItemPropertySource
+               org.eclipse.emf.compare.provider.ISemanticObjectLabelProvider
+               org.eclipse.emf.compare.provider.IItemStyledLabelProvider
+               org.eclipse.emf.compare.provider.IItemDescriptionProvider"
+            context="org.eclipse.papyrus.compare.uml2.edit.internal.decorator.PapyrusItemProviderContextTester"
+            description="Presents Papyrus-specific semantics of certain changes in a comparison."
+            label="Papyrus diff item provider"
+            optional="false"
+            ranking="80"
+            uri="http://www.eclipse.org/emf/compare">
+      </factory>
    </extension>
+
 </plugin>
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/Activator.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/Activator.java
index 74be0ea..4b452ad 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/Activator.java
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/Activator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2014, 2016 Obeo and others.
+ * Copyright (c) 2014, 2018 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
@@ -8,11 +8,14 @@
  * Contributors:
  *     Obeo - initial API and implementation
  *     Alexandra Buzila - bug 483798
+ *     Christian W. Damus - bug 529253
  *******************************************************************************/
 package org.eclipse.papyrus.compare.uml2.edit;
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
 import org.eclipse.papyrus.infra.core.services.ServiceException;
 import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
 import org.eclipse.papyrus.infra.services.labelprovider.service.impl.LabelProviderServiceImpl;
@@ -35,26 +38,20 @@
 	/** The label provider service. */
 	private LabelProviderService labelProviderService;
 
+	private ResourceLocator resourceLocator;
+
 	/**
 	 * The constructor.
 	 */
 	public Activator() {
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
 	@Override
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
 		plugin = this;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
 	@Override
 	public void stop(BundleContext context) throws Exception {
 		plugin = null;
@@ -98,4 +95,17 @@
 		return labelProviderService;
 	}
 
+	/**
+	 * Obtain a resource locator for this plug-in.
+	 * 
+	 * @return my resource locator
+	 */
+	public ResourceLocator getResourceLocator() {
+		if (resourceLocator == null) {
+			resourceLocator = new EMFPlugin.EclipsePlugin() {
+				// Pass
+			};
+		}
+		return resourceLocator;
+	}
 }
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/ForwardingItemProviderDecorator.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/ForwardingItemProviderDecorator.java
new file mode 100644
index 0000000..bdf4d36
--- /dev/null
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/ForwardingItemProviderDecorator.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *      Christian W. Damus - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.compare.uml2.edit.internal.decorator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.compare.provider.ExtendedItemProviderDecorator;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
+import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
+import org.eclipse.emf.compare.provider.ISemanticObjectLabelProvider;
+import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString.IComposedStyledString;
+import org.eclipse.emf.edit.EMFEditPlugin;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedImage;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemColorProvider;
+import org.eclipse.emf.edit.provider.IItemFontProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.papyrus.compare.uml2.edit.Activator;
+
+/**
+ * A simple forwarding item-provider decorator that implements all of the optional provider interfaces.
+ */
+public class ForwardingItemProviderDecorator extends ExtendedItemProviderDecorator implements IEditingDomainItemProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider, IItemStyledLabelProvider, IItemDescriptionProvider, ISemanticObjectLabelProvider {
+
+	/**
+	 * Initializes me with my adapter factory.
+	 * 
+	 * @param adapterFactory
+	 *            my adapter factory
+	 */
+	public ForwardingItemProviderDecorator(ComposeableAdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	public String getSemanticObjectLabel(Object object) {
+		if (decoratedItemProvider instanceof ISemanticObjectLabelProvider) {
+			return ((ISemanticObjectLabelProvider)decoratedItemProvider).getSemanticObjectLabel(object);
+		}
+
+		return null;
+	}
+
+	public String getDescription(Object object) {
+		if (decoratedItemProvider instanceof IItemDescriptionProvider) {
+			return ((IItemDescriptionProvider)decoratedItemProvider).getDescription(object);
+		}
+
+		return getText(object);
+	}
+
+	public IComposedStyledString getStyledText(Object object) {
+		if (decoratedItemProvider instanceof IItemStyledLabelProvider) {
+			return ((IItemStyledLabelProvider)decoratedItemProvider).getStyledText(object);
+		}
+
+		String text = getText(object);
+		if (text != null) {
+			return new ComposedStyledString(text);
+		}
+
+		return null;
+	}
+
+	protected String getString(String key) {
+		return Activator.getDefault().getResourceLocator().getString(key);
+	}
+
+	protected String getString(String key, boolean translate) {
+		return Activator.getDefault().getResourceLocator().getString(key, translate);
+	}
+
+	protected String getString(String key, Object[] substitutions) {
+		return Activator.getDefault().getResourceLocator().getString(key, substitutions);
+	}
+
+	protected String getString(String key, Object[] substitutions, boolean translate) {
+		return Activator.getDefault().getResourceLocator().getString(key, substitutions, translate);
+	}
+
+	protected Object overlayImage(Object object, Object image) {
+		Object result = image;
+
+		if (AdapterFactoryEditingDomain.isControlled(object)) {
+			List<Object> images = new ArrayList<Object>(2);
+			images.add(image);
+			images.add(EMFEditPlugin.INSTANCE.getImage("full/ovr16/ControlledObject")); //$NON-NLS-1$
+			result = new ComposedImage(images);
+		}
+
+		return result;
+	}
+
+}
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/PapyrusCompareItemProviderAdapterFactoryDecorator.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/PapyrusCompareItemProviderAdapterFactoryDecorator.java
new file mode 100644
index 0000000..580ef6d
--- /dev/null
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/PapyrusCompareItemProviderAdapterFactoryDecorator.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *    Christian W. Damus - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.compare.uml2.edit.internal.decorator;
+
+import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.ResourceRefactoringChange.isResourceRefactoringChange;
+
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.provider.spec.CompareItemProviderAdapterFactorySpec;
+import org.eclipse.emf.compare.util.CompareSwitch;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.DecoratorAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemProviderDecorator;
+
+/**
+ * Decorator adapter factory for comparison elements (diffs and such) in Papyrus UML comparisons.
+ * 
+ * @author Christian W. Damus
+ */
+public class PapyrusCompareItemProviderAdapterFactoryDecorator extends DecoratorAdapterFactory {
+
+	private final DecoratorSwitch decoratorSwitch = createDecoratorSwitch();
+
+	/**
+	 * Initializes me.
+	 */
+	public PapyrusCompareItemProviderAdapterFactoryDecorator() {
+		super(new CompareItemProviderAdapterFactorySpec());
+	}
+
+	@Override
+	public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+		super.setParentAdapterFactory(parentAdapterFactory);
+
+		if (parentAdapterFactory != null) {
+			// Compose our delegate after us so that its item delegators may
+			// find the entire factory space
+			parentAdapterFactory.addAdapterFactory(getDecoratedAdapterFactory());
+		}
+	}
+
+	protected DecoratorSwitch createDecoratorSwitch() {
+		return new DecoratorSwitch();
+	}
+
+	@Override
+	protected final IItemProviderDecorator createItemProviderDecorator(Object target, Object type) {
+		return decoratorSwitch.doSwitch(target);
+	}
+
+	protected IItemProviderDecorator createDefaultItemProviderDecorator() {
+		return new ForwardingItemProviderDecorator(this);
+	}
+
+	protected IItemProviderDecorator createResourceRefactoringChangeItemProviderDecorator() {
+		return new ResourceRefactoringChangeItemProviderDecorator(this);
+	}
+
+	//
+	// Nested types
+	//
+
+	protected class DecoratorSwitch extends CompareSwitch<IItemProviderDecorator> {
+		public IItemProviderDecorator doSwitch(Object object) {
+			if (object instanceof EObject) {
+				return doSwitch((EObject)object);
+			} else {
+				return createDefaultItemProviderDecorator();
+			}
+		}
+
+		@Override
+		public IItemProviderDecorator defaultCase(EObject object) {
+			return createDefaultItemProviderDecorator();
+		}
+
+		@Override
+		public IItemProviderDecorator caseResourceAttachmentChange(ResourceAttachmentChange object) {
+			if (isResourceRefactoringChange(object)) {
+				return createResourceRefactoringChangeItemProviderDecorator();
+			}
+			return null;
+		}
+	}
+}
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/ResourceRefactoringChangeItemProviderDecorator.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/ResourceRefactoringChangeItemProviderDecorator.java
new file mode 100644
index 0000000..4c5f234
--- /dev/null
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2.edit/src/org/eclipse/papyrus/compare/uml2/edit/internal/decorator/ResourceRefactoringChangeItemProviderDecorator.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *    Christian W. Damus - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.compare.uml2.edit.internal.decorator;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString.IComposedStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString.Style;
+import org.eclipse.emf.compare.utils.MatchUtil;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.papyrus.compare.uml2.internal.postprocessor.ResourceRefactoringChange;
+
+/**
+ * An item-provider decorator for {@link ResourceAttachmentChange}s that represent resource refactorings. The
+ * diff is presented as the inverse change from the opposite side so that it may make sense that it is
+ * rejected by implication of certain changes from that opposite side. Because, from the perspective of the
+ * left side, that is what accepting this change would do.
+ *
+ * @author Christian W. Damus
+ */
+public class ResourceRefactoringChangeItemProviderDecorator extends ForwardingItemProviderDecorator {
+
+	public ResourceRefactoringChangeItemProviderDecorator(ComposeableAdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	/**
+	 * Coerce a {@code diff} as a {@link ResourceRefactoringChange}.
+	 * 
+	 * @param diff
+	 *            a resource refactoring diff
+	 * @return the {@code diff} as its proper type
+	 * @precondition {@code diff is-a} {@link ResourceRefactoringChange}
+	 */
+	protected ResourceRefactoringChange asResourceRefactoringChange(Object diff) {
+		checkArgument(diff instanceof ResourceAttachmentChange, "%s is not a ResourceAttachmentChange", diff); //$NON-NLS-1$
+		return ResourceRefactoringChange.get((Diff)diff);
+	}
+
+	/**
+	 * Obtains the resource that was refactored in the given {@code diff}.
+	 * 
+	 * @param diff
+	 *            a resource refactoring diff
+	 * @return the refactored resource
+	 * @precondition {@code diff is-a} {@link ResourceRefactoringChange}
+	 */
+	protected Resource getRefactoredResource(Object diff) {
+		return getRefactoredResource(asResourceRefactoringChange(diff));
+	}
+
+	/**
+	 * Obtains the resource that was refactored in the given {@code diff}.
+	 * 
+	 * @param diff
+	 *            a resource refactoring diff
+	 * @return the refactored resource
+	 * @postcondition {@code result != null}
+	 */
+	protected Resource getRefactoredResource(ResourceRefactoringChange diff) {
+
+		// We wouldn't have this diff if the match didn't have both left and right sides
+		DifferenceSource side;
+		if (diff.getState() == DifferenceState.DISCARDED) {
+			side = diff.getSource();
+		} else {
+			side = opposite(diff.getSource());
+		}
+		Resource result = MatchUtil.getMatchedObject(diff.getMatch(), side).eResource();
+
+		if (result == null) {
+			throw new IllegalStateException("diff has no resource on its source side"); //$NON-NLS-1$
+		}
+
+		return result;
+	}
+
+	@Override
+	public Object getImage(Object object) {
+		ResourceRefactoringChange diff = asResourceRefactoringChange(object);
+		Resource resource = getRefactoredResource(diff);
+
+		Object result = getItemDelegator().getImage(resource);
+		if (result == null) {
+			result = super.getImage(diff);
+		}
+
+		// Invert the presentation
+		ResourceAttachmentChange realDiff = diff.toDiff();
+		boolean oldDeliver = realDiff.eDeliver();
+		try {
+			// Flip the direction to get the opposite decoration
+			realDiff.eSetDeliver(false);
+			realDiff.setSource(opposite(realDiff.getSource()));
+			Object overlay = getOverlayProvider().getComposedImage(realDiff, result);
+
+			result = overlayImage(object, overlay);
+		} finally {
+			// Restore the direction
+			realDiff.setSource(opposite(realDiff.getSource()));
+			realDiff.eSetDeliver(oldDeliver);
+		}
+
+		return result;
+	}
+
+	@Override
+	public String getText(Object object) {
+		return getStyledText(object).getString();
+	}
+
+	@Override
+	public IComposedStyledString getStyledText(Object object) {
+		final ResourceRefactoringChange diff = asResourceRefactoringChange(object);
+
+		String value = getString("_UI_ResourceRefactoringChange_label", //$NON-NLS-1$
+				new Object[] {getSemanticObjectLabel(diff.toDiff()) });
+
+		final Style baseStyle;
+		switch (diff.getState()) {
+			case MERGED:
+			case DISCARDED:
+				baseStyle = Style.QUALIFIER_STYLER;
+				break;
+			default:
+				baseStyle = Style.NO_STYLE;
+				break;
+		}
+		ComposedStyledString result = new ComposedStyledString(value, baseStyle);
+
+		// When the diff is rejected, we show the new URI, so present the decoration
+		// with the old URI
+		DifferenceSource decorationDirection = diff.getState() != DifferenceState.DISCARDED //
+				? DifferenceSource.RIGHT
+				: DifferenceSource.LEFT;
+		switch (diff.getKind()) {
+			case MOVE:
+				switch (decorationDirection) {
+					case RIGHT: // Invert the presentation
+						result.append(getString("_UI_ResourceRefactoringChange_detailLeft", //$NON-NLS-1$
+								new Object[] {diff.getNewURI() }), Style.DECORATIONS_STYLER);
+						break;
+					case LEFT: // Invert the presentation
+						result.append(getString("_UI_ResourceRefactoringChange_detailRight", //$NON-NLS-1$
+								new Object[] {diff.getOldURI() }), Style.DECORATIONS_STYLER);
+						break;
+					default:
+						throw new IllegalArgumentException("diff side " + diff.getSource()); //$NON-NLS-1$
+				}
+				break;
+			default:
+				result.append(getString("_UI_ResourceRefactoringChange_detail", //$NON-NLS-1$
+						new Object[] {diff.getNewURI() }), Style.DECORATIONS_STYLER);
+				break;
+		}
+
+		return result;
+	}
+
+	@Override
+	public String getSemanticObjectLabel(Object object) {
+		return getItemDelegator().getText(getRefactoredResource(object));
+	}
+
+	@Override
+	public String getDescription(Object object) {
+		final ResourceRefactoringChange diff = asResourceRefactoringChange(object);
+		String subject = getSemanticObjectLabel(diff);
+
+		String action;
+		switch (diff.getSource()) {
+			case RIGHT: // Invert the presentation
+				action = getString("_UI_ResourceRefactoringChange_desc_actionLeft"); //$NON-NLS-1$
+				break;
+			case LEFT: // Invert the presentation
+				action = getString("_UI_ResourceRefactoringChange_desc_actionRight"); //$NON-NLS-1$
+				break;
+			default:
+				throw new IllegalArgumentException("diff side " + diff.getSource()); //$NON-NLS-1$
+		}
+
+		// Invert the presentation
+		return getString("_UI_ResourceRefactoringChange_desc", //$NON-NLS-1$
+				new Object[] {subject, action, diff.getOldURI(), diff.getNewURI() });
+	}
+
+	static DifferenceSource opposite(DifferenceSource side) {
+		return DifferenceSource.VALUES.get(1 - side.ordinal());
+	}
+}
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/META-INF/MANIFEST.MF b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/META-INF/MANIFEST.MF
index dba9b15..4e3d584 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/META-INF/MANIFEST.MF
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/META-INF/MANIFEST.MF
@@ -17,9 +17,13 @@
  org.apache.commons.lang;bundle-version="[2.6.0,3.0.0)",
  org.eclipse.emf.compare.uml2;bundle-version="2.5.0",
  org.eclipse.emf.compare.ide;bundle-version="3.3.0",
- org.eclipse.emf.compare;bundle-version="[3.5.1,4.0.0)"
-Export-Package: org.eclipse.papyrus.compare.uml2.internal.hook,
- org.eclipse.papyrus.compare.uml2.internal.hook.migration
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.compare;bundle-version="[3.5.1,4.0.0)";visibility:=reexport
+Export-Package: org.eclipse.papyrus.compare.uml2.internal;x-internal:=true,
+ org.eclipse.papyrus.compare.uml2.internal.hook;x-internal:=true,
+ org.eclipse.papyrus.compare.uml2.internal.hook.migration;x-internal:=true,
+ org.eclipse.papyrus.compare.uml2.internal.postprocessor;x-friends:="org.eclipse.papyrus.compare.uml2.edit"
 Import-Package: com.google.common.base;version="[15.0.0,22.0.0)",
  com.google.common.collect;version="[15.0.0,22.0.0)"
 Bundle-ActivationPolicy: lazy
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/hook/ProfileMigrationHook.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/hook/ProfileMigrationHook.java
index 3e131fa..33dd42c 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/hook/ProfileMigrationHook.java
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/hook/ProfileMigrationHook.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2016, 2017 EclipseSource Services GmbH and others.
+ * Copyright (c) 2016, 2018 EclipseSource Services GmbH 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
@@ -8,24 +8,34 @@
  * Contributors:
  *     Martin Fleck - initial API and implementation
  *     Philip Langer - bug 516484
+ *     Christian W. Damus - bug 529217
  *******************************************************************************/
 package org.eclipse.papyrus.compare.uml2.internal.hook;
 
+import static org.eclipse.papyrus.infra.emf.internal.resource.AbstractCrossReferenceIndex.SHARD_ANNOTATION_SOURCE;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.ListIterator;
 
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.emf.common.util.BasicDiagnostic;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.compare.ide.hook.AbstractResourceSetHooks;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.InternalEObject;
 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.ecore.util.InternalEList;
 import org.eclipse.papyrus.compare.uml2.internal.hook.migration.StereotypeApplicationRepair;
 import org.eclipse.papyrus.uml.modelrepair.internal.stereotypes.IRepairAction;
 import org.eclipse.papyrus.uml.modelrepair.internal.stereotypes.ZombieStereotypesDescriptor;
 import org.eclipse.papyrus.uml.tools.model.UmlModel;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.eclipse.uml2.uml.UMLPackage;
 
 /**
  * This class migrates missing UML stereotype applications before the comparison, if possible. For any missing
@@ -46,6 +56,17 @@
 			return; // we are not responsible
 		}
 
+		// Two stages: ensure sub-unit linkages and then repair
+
+		// First, ensure that the linkages between sub-units are correctly
+		// established (container proxies) so that packages can find profile
+		// applications in parent units and we don't create redundant new
+		// profile applications in the next step that will introduce bogus diffs
+		for (final Resource umlResource : umlResources) {
+			ensureParentUnitLinkage(umlResource);
+		}
+
+		// Then, do whatever it takes to repair profile applications
 		for (final Resource umlResource : umlResources) {
 			repairProfileApplications(umlResource);
 		}
@@ -139,4 +160,41 @@
 			repair.dispose();
 		}
 	}
+
+	/**
+	 * Ensure that a sub-model unit correctly resolves its {@code eContainer} link to its parent unit so that
+	 * profile applications may be found in that parent unit.
+	 * 
+	 * @param resource
+	 *            a UML resource that may or may not be a sub-model unit
+	 */
+	protected void ensureParentUnitLinkage(Resource resource) {
+		org.eclipse.uml2.uml.Package subUnit = (org.eclipse.uml2.uml.Package)EcoreUtil
+				.getObjectByType(resource.getContents(), UMLPackage.Literals.PACKAGE);
+		if (subUnit != null) {
+			// Search for the shard annotation and resolve the parent package's
+			// proxy for this nested package
+			EAnnotation annotation = subUnit.getEAnnotation(SHARD_ANNOTATION_SOURCE);
+			if (annotation != null) {
+				org.eclipse.uml2.uml.Package parentUnit = (org.eclipse.uml2.uml.Package)EcoreUtil
+						.getObjectByType(annotation.getReferences(), UMLPackage.Literals.PACKAGE);
+				if (parentUnit != null) {
+					final URI proxyURI = EcoreUtil.getURI(subUnit);
+
+					// Trigger containment proxy resolution
+					for (ListIterator<PackageableElement> iter = ((InternalEList<PackageableElement>)parentUnit
+							.getPackagedElements()).basicListIterator(); iter.hasNext();) {
+
+						PackageableElement next = iter.next();
+						if (proxyURI.equals(((InternalEObject)next).eProxyURI())) {
+							parentUnit.getPackagedElements().get(iter.previousIndex());
+
+							// Needn't continue further
+							break;
+						}
+					}
+				}
+			}
+		}
+	}
 }
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusPostProcessor.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusPostProcessor.java
index 2e7f03f..3430aff 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusPostProcessor.java
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusPostProcessor.java
@@ -12,24 +12,40 @@
 package org.eclipse.papyrus.compare.uml2.internal.postprocessor;
 
 import static com.google.common.base.Predicates.and;
+import static com.google.common.base.Predicates.not;
+import static com.google.common.collect.Iterables.any;
 import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.getFirst;
+import static com.google.common.collect.Iterables.transform;
 import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
+import static org.eclipse.emf.compare.utils.MatchUtil.getMatchedObject;
 import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.getResource;
+import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.getURI;
 import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.index;
 import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.opposite;
-import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.setResource;
-import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.setURI;
+import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.ResourceRefactoringChange.isResourceRefactoringChange;
+import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.ResourceRefactoringChange.onSide;
 
 import com.google.common.base.Predicate;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Iterables;
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Sets;
 
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
-import java.util.Map;
+import java.util.List;
+import java.util.Set;
 
+import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.common.util.Monitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.CompareFactory;
 import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Conflict;
 import org.eclipse.emf.compare.Diff;
 import org.eclipse.emf.compare.DifferenceKind;
 import org.eclipse.emf.compare.DifferenceSource;
@@ -39,14 +55,24 @@
 import org.eclipse.emf.compare.ResourceAttachmentChange;
 import org.eclipse.emf.compare.postprocessor.IPostProcessor;
 import org.eclipse.emf.compare.uml2.internal.postprocessor.util.UMLCompareUtil;
+import org.eclipse.emf.compare.util.CompareSwitch;
 import org.eclipse.emf.compare.utils.MatchUtil;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.InternalEObject;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.UMLPackage;
 
 /**
- * Post-processor for comparisons of Papyrus models.
+ * Post-processor for comparisons of Papyrus models. Specialized diffs that it looks for include:
+ * <ul>
+ * <li>{@link ResourceRefactoringChange}s in matches of root objects of resources that are refactored (URIs
+ * changed by rename or move) and which, therefore, are not actually logically moving those root objects.
+ * These changes therefore replace {@link ResourceAttachmentChange}s computed by the diff engine</li>
+ * </ul>
  *
  * @author Christian W. Damus
  */
@@ -60,13 +86,6 @@
 			ofKind(DifferenceKind.MOVE));
 
 	/**
-	 * A predicate matching diffs that are {@link ResourceAttachmentChange}s that move the principal UML
-	 * element of a resource.
-	 */
-	static final Predicate<Diff> IS_RESOURCE_REFACTORING_MOVE = and(isResourceRefactoringRAC(),
-			ofKind(DifferenceKind.MOVE));
-
-	/**
 	 * Initializes me.
 	 */
 	public PapyrusPostProcessor() {
@@ -74,8 +93,7 @@
 	}
 
 	public void postMatch(Comparison comparison, Monitor monitor) {
-		// Handle refactoring of model resources, esp. sub-units
-		rematchRefactoredUMLResources(comparison, monitor);
+		// Pass
 	}
 
 	public void postDiff(Comparison comparison, Monitor monitor) {
@@ -93,7 +111,9 @@
 	}
 
 	public void postConflicts(Comparison comparison, Monitor monitor) {
-		// Pass
+		// Handle refactoring of model resources, esp. sub-units
+		rematchRefactoredUMLResources(comparison, monitor);
+		pruneRACsInRefactoredResources(comparison, monitor);
 	}
 
 	public void postComparison(Comparison comparison, Monitor monitor) {
@@ -165,30 +185,6 @@
 	}
 
 	/**
-	 * Obtains a predicate matching {@link ResourceAttachmentChange}s of UML elements that signify the
-	 * refactoring (rename/move) of a resource.
-	 * 
-	 * @return the is-resource-refactoring-RAC predicate
-	 */
-	protected static Predicate<Diff> isResourceRefactoringRAC() {
-		return new Predicate<Diff>() {
-			public boolean apply(Diff input) {
-				if (!(input instanceof ResourceAttachmentChange)) {
-					return false;
-				}
-
-				Match match = input.getMatch();
-				EObject object = match.getLeft();
-				if (object == null) {
-					object = match.getRight();
-				}
-
-				return object instanceof Element && index(match).getResourceRefactoring(match) != null;
-			}
-		};
-	}
-
-	/**
 	 * Find the nearest diff to a given {@code match} that moves it (perhaps indirectly via the content tree)
 	 * from a resource to another resource.
 	 * 
@@ -246,44 +242,50 @@
 	 */
 	protected void rematchRefactoredUMLResources(Comparison comparison, Monitor monitor) {
 		// Look for renamed resources, which are matched by their root UML elements
-		Map<Resource, MatchResource> updates = Maps.newHashMap();
-		PapyrusResourceIndex resourceGroups = index(comparison);
+		Set<Resource> processed = Sets.newHashSet();
+		Multimap<Match, ResourceRefactoringChange> diffs = ArrayListMultimap.create();
+		PapyrusResourceIndex index = index(comparison);
 
 		for (MatchResource mres : comparison.getMatchedResources()) {
-			if (!rematch(comparison, mres, DifferenceSource.LEFT, resourceGroups, updates)) {
-				// Try the other way around
-				rematch(comparison, mres, DifferenceSource.RIGHT, resourceGroups, updates);
+			Match rootMatch = null;
+			for (DifferenceSource side : DifferenceSource.VALUES) {
+				rootMatch = rematch(comparison, mres, side, index, processed);
+				if (rootMatch != null //
+						&& (!diffs.containsKey(rootMatch) || !any(diffs.get(rootMatch), onSide(side)))) {
+
+					ResourceRefactoringChange uriDiff = null;
+
+					if (rootMatch.getOrigin() != null) {
+						uriDiff = ResourceRefactoringChange.demand(rootMatch, side);
+						diffs.put(rootMatch, uriDiff);
+						uriDiff.setNewURI(getMatchedObject(rootMatch, side).eResource().getURI());
+						// We know that the origin also has a direct resource because we filter
+						// out control-control conflicts
+						uriDiff.setOldURI(rootMatch.getOrigin().eResource().getURI());
+					} else if (side == DifferenceSource.RIGHT) {
+						// In two-way comparison, only consider incoming (right) as
+						// imposing the change
+						uriDiff = ResourceRefactoringChange.demand(rootMatch, side);
+						diffs.put(rootMatch, uriDiff);
+						DifferenceSource opposite = opposite(side);
+						uriDiff.setNewURI(getMatchedObject(rootMatch, opposite).eResource().getURI());
+						uriDiff.setOldURI(getResource(mres, side).getURI());
+					}
+
+					if (uriDiff != null) {
+						index.addResourceRefactoring(rootMatch);
+						findDependencies(comparison, uriDiff);
+					}
+				}
 			}
 		}
 
-		if (!updates.isEmpty()) {
-			// Remove incomplete matches
-			for (Iterator<MatchResource> iter = Lists.reverse(comparison.getMatchedResources())
-					.iterator(); iter.hasNext() && !updates.isEmpty();) {
+		// Look for conflicts in resources refactored on both sides
+		for (Match objectMatch : diffs.keySet()) {
+			Collection<ResourceRefactoringChange> uriDiffs = diffs.get(objectMatch);
 
-				MatchResource next = iter.next();
-
-				MatchResource update = updates.remove(next.getLeft());
-				if (update == null || update == next) {
-					update = updates.remove(next.getRight());
-					if (update == next) {
-						update = null;
-					}
-				}
-
-				if (update != null) {
-					// MatchResource::locationChanges is no longer used,
-					// so don't worry about updating that
-
-					// Capture the origin from the match we're deleting
-					if (update.getOrigin() == null) {
-						update.setOrigin(next.getOrigin());
-						update.setOriginURI(next.getOriginURI());
-					}
-
-					// Remove the redundant match
-					iter.remove();
-				}
+			if (uriDiffs.size() > 1) {
+				conflict(comparison, uriDiffs);
 			}
 		}
 	}
@@ -301,91 +303,201 @@
 	 *            the side from which to try to find a new match on the other side
 	 * @param index
 	 *            an index of relationships between resources in the context of the the {@code comparison}
-	 * @param updates
-	 *            collects the incomplete matches of resources that were merged into incomplete matches on the
-	 *            other side, which need to be removed from the {@code comparison} in a subsequent step
-	 *            (because it isn't safe to do so in-line)
-	 * @return {@code true} if a new match was found for the resource from this {@code side}; {@code false},
-	 *         otherwise
+	 * @param processed
+	 *            collects the resources that we've searched for
+	 * @return the match for a {@link ResourceAttachmentChange} that indicates the resource refactoring, or
+	 *         {@code null} if none
 	 */
-	protected boolean rematch(Comparison comparison, MatchResource mres, DifferenceSource side,
-			PapyrusResourceIndex index, Map<Resource, MatchResource> updates) {
+	protected Match rematch(Comparison comparison, MatchResource mres, DifferenceSource side,
+			PapyrusResourceIndex index, Set<Resource> processed) {
+
+		Match result = null;
 
 		final DifferenceSource opposite = opposite(side);
 		final Resource oneSide = getResource(mres, side);
 		final Resource otherSide = getResource(mres, opposite);
 
-		if (oneSide != null && otherSide == null) {
-			// Don't process a resource match that we've already melded into another
-			if (!updates.containsKey(oneSide) && !oneSide.getContents().isEmpty()) {
-				EObject root = oneSide.getContents().get(0);
-				if (!(root instanceof Element)) {
+		// Did this side actually change the resource URI?
+		out: if (oneSide != null && otherSide == null
+				&& (mres.getOriginURI() == null || !mres.getOriginURI().equals(getURI(mres, side)))) {
+
+			// Don't process a resource match that we've already seen
+			if (processed.add(oneSide) && !oneSide.getContents().isEmpty()) {
+				EObject root = (Element)EcoreUtil.getObjectByType(oneSide.getContents(),
+						UMLPackage.Literals.ELEMENT);
+
+				if (root == null) {
 					// Only need this for UML resources that reliably contain
 					// only one real element, to handle stereotype applications
 					// that are additional non-UML roots
-					return false;
+					break out;
 				}
 
 				Match rootMatch = comparison.getMatch(root);
 				if (rootMatch != null) {
 					EObject otherRoot = MatchUtil.getMatchedObject(rootMatch, opposite);
-					if (otherRoot == null) {
-						return false;
-					}
+					if (otherRoot != null) {
+						Resource other = ((InternalEObject)otherRoot).eDirectResource();
 
-					Resource other = ((InternalEObject)otherRoot).eDirectResource();
-					if (other != null) {
-						combine(mres, other, opposite, index, updates);
-						return true;
+						// If this is three-way and the origin exists and is uncontrolled,
+						// then this is a control-control conflict, not a refactoring of
+						// a controlled unit
+						if (other != null && !isControlControlConflict(rootMatch)) {
+							result = rootMatch;
+						}
 					}
 				}
 			}
 		}
 
-		return false;
+		return result;
+	}
+
+	private boolean isControlControlConflict(Match rootMatch) {
+		EObject origin = rootMatch.getOrigin();
+		return origin instanceof InternalEObject && ((InternalEObject)origin).eDirectResource() == null;
 	}
 
 	/**
-	 * Combine a resource match with an{@code other} resource.
+	 * Find the dependencies of a resource refactoring change and add them to its {@link Diff#getRequiredBy()
+	 * requiredBy} list.
 	 * 
-	 * @param uml
-	 *            an unmatched UML resource to complete with the {@code other}
-	 * @param other
-	 *            a resource with which to complete the match
-	 * @param otherSide
-	 *            the side on which the {@code other} resource is
-	 * @param index
-	 *            an index of relationships between resources in the context of the the {@code comparison}
-	 * @param updates
-	 *            collects the incomplete matches of resources that were merged into incomplete matches on the
-	 *            other side, which need to be removed from the {@code comparison} in a subsequent step
-	 *            (because it isn't safe to do so in-line)
+	 * @param comparison
+	 *            the contextual comparison
+	 * @param rrc
+	 *            a resource refactoring change
 	 */
-	protected void combine(MatchResource uml, Resource other, DifferenceSource otherSide,
-			PapyrusResourceIndex index, Map<Resource, MatchResource> updates) {
+	protected void findDependencies(final Comparison comparison, final ResourceRefactoringChange rrc) {
+		// This change is required by any change that moves objects into or out
+		// of the new resource (on the the same side) or into or out of the old
+		// resource (on the opposide side)
+		class DependencySwitch extends CompareSwitch<URI> {
+			@Override
+			public URI caseResourceAttachmentChange(ResourceAttachmentChange object) {
+				return URI.createURI(object.getResourceURI());
+			}
 
-		// Meld the matches for the UML resource
-		setResource(uml, otherSide, other);
-		setURI(uml, otherSide, other.getURI().toString());
-		updates.put(other, uml);
+			@Override
+			public URI caseReferenceChange(ReferenceChange object) {
+				if (object.getReference().isContainment()) {
+					return object.getValue().eResource().getURI();
+				}
+				return null;
+			}
+		}
 
-		// And do the same for other Papyrus resources in the same group
-		DifferenceSource thisSide = opposite(otherSide);
-		Map<String, MatchResource> thisGroup = index.getGroup(uml, thisSide);
-		Map<String, MatchResource> otherGroup = index.getGroup(uml, otherSide);
+		DependencySwitch dep = new DependencySwitch();
 
-		for (Map.Entry<String, MatchResource> next : thisGroup.entrySet()) {
-			MatchResource combine = next.getValue();
-
-			if (combine != uml && getResource(combine, otherSide) == null) {
-				MatchResource combineWith = otherGroup.get(next.getKey());
-				if (combineWith != null && getResource(combineWith, thisSide) == null) {
-					Resource combineWithResource = getResource(combineWith, otherSide);
-					setResource(combine, otherSide, combineWithResource);
-					setURI(combine, otherSide, combineWithResource.getURI().toString());
-					updates.put(combineWithResource, combine);
+		for (Diff next : comparison.getDifferences()) {
+			URI nextURI = dep.doSwitch(next);
+			if (nextURI != null) {
+				if (next.getSource() == rrc.getSource()) {
+					if (rrc.getNewURI().equals(nextURI)) {
+						rrc.getRequiredBy().add(next);
+					}
+				} else if (rrc.getOldURI().equals(nextURI)) {
+					rrc.getRequiredBy().add(next);
 				}
 			}
 		}
+
+	}
+
+	/**
+	 * Create a new conflict on a bunch of {@code diffs}.
+	 * 
+	 * @param comparison
+	 *            the comparison in which to create the conflict
+	 * @param diffs
+	 *            the conflicting diffs
+	 * @return the conflict
+	 * @throws IllegalArgumentException
+	 *             if there aren't at least two {@code diffs}
+	 */
+	protected Conflict conflict(Comparison comparison, Iterable<ResourceRefactoringChange> diffs) {
+		if (Iterables.size(diffs) < 2) {
+			throw new IllegalArgumentException("diffs.size() < 2"); //$NON-NLS-1$
+		}
+
+		Conflict result = CompareFactory.eINSTANCE.createConflict();
+		EList<Diff> conflict = result.getDifferences();
+		for (ResourceRefactoringChange next : diffs) {
+			conflict.add(next.toDiff());
+		}
+		comparison.getConflicts().add(result);
+		return result;
+	}
+
+	/**
+	 * Prune out {@link ResourceAttachmentChange}s that aren't really RACs at all because they actually are
+	 * staying within a refactored (moved/renamed) resource.
+	 * 
+	 * @param comparison
+	 *            the contextual comparison
+	 * @param monitor
+	 *            a progress monitor
+	 */
+	protected void pruneRACsInRefactoredResources(Comparison comparison, Monitor monitor) {
+		PapyrusResourceIndex index = PapyrusResourceIndex.index(comparison);
+
+		Iterable<ResourceAttachmentChange> racs = filter(
+				filter(comparison.getDifferences(), ResourceAttachmentChange.class),
+				not(isResourceRefactoringChange())); // Don't prune out the RRCs, themselves!
+		List<ResourceAttachmentChange> toPrune = Lists.newArrayList();
+
+		for (ResourceAttachmentChange next : racs) {
+			if (index.isInResourceRefactoring(next) && !isResourceRefactoringChange(next)) {
+				toPrune.add(next);
+			}
+		}
+
+		for (ResourceAttachmentChange next : toPrune) {
+			// Infer conflicts for the ResourceRefactoringChange
+			Conflict conflict = next.getConflict();
+			if (conflict != null) {
+				ResourceRefactoringChange rrc = getFirst(
+						transform(filter(next.getMatch().getDifferences(), isResourceRefactoringChange()),
+								ResourceRefactoringChange.get()),
+						null);
+				if (rrc != null) {
+					Collections.replaceAll(conflict.getDifferences(), next, rrc.toDiff());
+				}
+			}
+
+			delete(next);
+		}
+	}
+
+	/**
+	 * Delete an {@code object} from the comparison, taking advantage of the cross-referencers employed by the
+	 * comparison for efficient removal of incoming references to the {@code object}.
+	 * 
+	 * @param object
+	 *            the object to delete from the comparison
+	 */
+	static void delete(EObject object) {
+		if (object instanceof Diff) {
+			// First, delete any conflict and equivalence that depend on the diff
+			Diff diff = (Diff)object;
+			if (diff.getConflict() != null) {
+				delete(diff.getConflict());
+			}
+			if (diff.getEquivalence() != null) {
+				delete(diff.getEquivalence());
+			}
+		}
+
+		// We always have the DiffCrossReferencer and/or the MatchCrossReferencer
+		ECrossReferenceAdapter xrefs = ECrossReferenceAdapter.getCrossReferenceAdapter(object);
+		if (xrefs != null) {
+			// Do it the efficient way
+			for (EStructuralFeature.Setting setting : xrefs.getInverseReferences(object)) {
+				EcoreUtil.remove(setting, object);
+			}
+			EcoreUtil.remove(object);
+		} else {
+			// The expensive way
+			EcoreUtil.delete(object);
+		}
 	}
 }
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusResourceIndex.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusResourceIndex.java
index 053491d..1406318 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusResourceIndex.java
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusResourceIndex.java
@@ -11,7 +11,10 @@
  *******************************************************************************/
 package org.eclipse.papyrus.compare.uml2.internal.postprocessor;
 
-import com.google.common.base.Objects;
+import static org.eclipse.emf.compare.utils.MatchUtil.getMatchedObject;
+
+import com.google.common.collect.BiMap;
+import com.google.common.collect.HashBiMap;
 import com.google.common.collect.Maps;
 
 import java.util.Map;
@@ -22,9 +25,12 @@
 import org.eclipse.emf.compare.CompareFactory;
 import org.eclipse.emf.compare.ComparePackage;
 import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceKind;
 import org.eclipse.emf.compare.DifferenceSource;
 import org.eclipse.emf.compare.Match;
 import org.eclipse.emf.compare.MatchResource;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -47,6 +53,9 @@
 	/** Token stored in the match cache for cache misses. */
 	private final MatchResource noMatch = CompareFactory.eINSTANCE.createMatchResource();
 
+	/** Mapping of refactorings. */
+	private final BiMap<MatchResource, MatchResource> refactorings;
+
 	/** The comparison that I index. */
 	private final Comparison comparison;
 
@@ -60,6 +69,7 @@
 		super();
 
 		this.comparison = comparison;
+		this.refactorings = HashBiMap.create(comparison.getMatchedResources().size());
 
 		for (MatchResource next : comparison.getMatchedResources()) {
 			if (next.getLeftURI() != null) {
@@ -139,41 +149,88 @@
 	}
 
 	/**
-	 * Obtains the match that represents the refactoring of a {@code resource} of which the given matched
-	 * object is a root. This resource match will match resources on either side that have different URIs,
-	 * which is the refactoring.
+	 * Register a resource refactoring inferred from the given root object match.
 	 * 
-	 * @param objectMatch
-	 *            a match of an object that is a UML resource root element, either the root of the entire
-	 *            model or of some sub-unit
-	 * @return the refactoring resource match that was inferred from the different resources in the given
-	 *         object match, or {@code null} if there is no refactoring of the resources containing the object
+	 * @param rootMatch
+	 *            a matched resource root apparently "moved" from one resource to another
 	 */
-	public MatchResource getResourceRefactoring(Match objectMatch) {
-		EObject left = objectMatch.getLeft();
-		EObject right = objectMatch.getRight();
+	public void addResourceRefactoring(Match rootMatch) {
+		EObject leftRoot = rootMatch.getLeft();
+		EObject rightRoot = rootMatch.getRight();
+		Resource leftRes = leftRoot.eResource();
+		Resource rightRes = rightRoot.eResource();
+		MatchResource leftMatch = getMatch(leftRes);
+		MatchResource rightMatch = getMatch(rightRes);
+		refactorings.put(leftMatch, rightMatch);
 
-		if (left == null || right == null) {
-			// There is no resource match if the object doesn't exist on both sides
-			return null;
+		// And do all of the group
+		for (Map.Entry<String, MatchResource> next : getGroup(leftMatch, DifferenceSource.LEFT).entrySet()) {
+			MatchResource nextLeft = next.getValue();
+			if (nextLeft != leftMatch) {
+				MatchResource nextRight = getGroup(rightMatch, DifferenceSource.RIGHT).get(next.getKey());
+				if (nextRight != null) {
+					refactorings.put(nextLeft, nextRight);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Queries whether the comparison involves any resource refactoring.
+	 * 
+	 * @return whether any resource is refactored in my comparison
+	 */
+	public boolean hasResourceRefactorings() {
+		return !refactorings.isEmpty();
+	}
+
+	/**
+	 * Obtains the other resource match, if any, in a refactoring pair.
+	 * 
+	 * @param match
+	 *            a resource match
+	 * @return the other participant in the refactoring, or {@code null} if the {@code match} is not involved
+	 *         in a refactoring
+	 */
+	public MatchResource getResourceRefactoring(MatchResource match) {
+		MatchResource result = refactorings.get(match);
+		if (result == null) {
+			result = refactorings.inverse().get(match);
+		}
+		return result;
+	}
+
+	/**
+	 * Queries whether a resource attachment change is a {@linkplain DifferenceKind#MOVE move} RAC that is
+	 * only really a pseudo-RAC because, in fact, the source and destination resources are the same resource
+	 * just refactored.
+	 * 
+	 * @param diff
+	 *            a resource attachment change
+	 * @return the other participant in the refactoring, or {@code null} if the {@code match} is not involved
+	 *         in a refactoring
+	 */
+	public boolean isInResourceRefactoring(ResourceAttachmentChange diff) {
+		if (diff.getKind() != DifferenceKind.MOVE) {
+			// Something that's not a move doesn't indicate refactoring of the resource
+			return false;
 		}
 
-		MatchResource leftRes = getMatch(left.eResource());
-		MatchResource rightRes = getMatch(right.eResource());
-
-		if (leftRes == null || rightRes == null) {
-			// We could not have detected a resource match without both sides
-			return null;
+		Match match = diff.getMatch();
+		EObject moved = getMatchedObject(match, diff.getSource());
+		Resource resource = moved.eResource();
+		MatchResource resourceMatch = getMatch(resource);
+		MatchResource otherMatch = getResourceRefactoring(resourceMatch);
+		if (otherMatch == null) {
+			return false;
 		}
 
-		if (Objects.equal(leftRes.getLeftURI(), rightRes.getRightURI())) {
-			// Not refactored
-			return null;
-		}
+		Resource otherSide = getResource(otherMatch, opposite(diff.getSource()));
 
-		// It's not a rename/move/etc. resource refactoring if the resources
-		// on the left and right were not matched together
-		return leftRes == rightRes ? leftRes : null;
+		// If it is not being moved from the old resource of the refactoring,
+		// then it's a real move
+		return otherSide != null && (match.getOrigin() == null
+				|| match.getOrigin().eResource().getURI().equals(otherSide.getURI()));
 	}
 
 	/**
@@ -204,6 +261,18 @@
 	}
 
 	/**
+	 * Obtains the unique (lazily computed) index of Papyrus resources in the context of the comparison
+	 * containing a {@code diff}.
+	 * 
+	 * @param diff
+	 *            a difference in some comparison
+	 * @return its resource index
+	 */
+	public static PapyrusResourceIndex index(Diff diff) {
+		return index(diff.getMatch());
+	}
+
+	/**
 	 * Compute the side opposite a given {@code side}.
 	 * 
 	 * @param side
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringChange.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringChange.java
new file mode 100644
index 0000000..aa53ccd
--- /dev/null
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringChange.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Christian W. Damus - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.compare.uml2.internal.postprocessor;
+
+import static com.google.common.collect.Iterables.filter;
+import static org.eclipse.emf.compare.DifferenceSource.LEFT;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.fromSide;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.utils.MatchUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/**
+ * An adapter for a {@link ResourceAttachmentChange} that represents a resource refactoring. It provides
+ * details of the resource's old and new {@link URI}s.
+ *
+ * @author Christian W. Damus
+ */
+public final class ResourceRefactoringChange implements Adapter {
+	private static final Object TYPE = new Object();
+
+	private final ResourceAttachmentChange rac;
+
+	private URI oldURI;
+
+	private URI newURI;
+
+	/**
+	 * Initializes me with the RAC that I wrap.
+	 * 
+	 * @param rac
+	 *            my wrapped diff
+	 */
+	private ResourceRefactoringChange(ResourceAttachmentChange rac) {
+		super();
+
+		this.rac = rac;
+		rac.eAdapters().add(this);
+	}
+
+	public static boolean isResourceRefactoringChange(Diff diff) {
+		return diff instanceof ResourceAttachmentChange && get(diff) != null;
+	}
+
+	public static Predicate<Diff> isResourceRefactoringChange() {
+		return new Predicate<Diff>() {
+			public boolean apply(Diff input) {
+				return isResourceRefactoringChange(input);
+			}
+		};
+	}
+
+	public static ResourceRefactoringChange get(Diff diff) {
+		if (diff instanceof ResourceAttachmentChange) {
+			return (ResourceRefactoringChange)EcoreUtil.getExistingAdapter(diff, TYPE);
+		}
+		return null;
+	}
+
+	public static Function<Diff, ResourceRefactoringChange> get() {
+		return new Function<Diff, ResourceRefactoringChange>() {
+			public ResourceRefactoringChange apply(Diff input) {
+				return get(input);
+			}
+		};
+	}
+
+	public static ResourceRefactoringChange demand(ResourceAttachmentChange rac) {
+		ResourceRefactoringChange result = get(rac);
+		if (result == null) {
+			result = new ResourceRefactoringChange(rac);
+		}
+		return result;
+	}
+
+	public static ResourceRefactoringChange demand(Match match, DifferenceSource side) {
+		return demand(getRAC(match, side));
+	}
+
+	private static ResourceAttachmentChange getRAC(Match match, DifferenceSource side) {
+		Iterable<ResourceAttachmentChange> racs = filter(match.getDifferences(),
+				ResourceAttachmentChange.class);
+		return Iterables.find(racs, fromSide(side));
+	}
+
+	public static Predicate<ResourceRefactoringChange> onSide(final DifferenceSource side) {
+		return new Predicate<ResourceRefactoringChange>() {
+			public boolean apply(ResourceRefactoringChange input) {
+				return (input != null) && input.getSource() == side;
+			}
+		};
+	}
+
+	public ResourceAttachmentChange toDiff() {
+		return rac;
+	}
+
+	/**
+	 * @return the oldURI
+	 */
+	public URI getOldURI() {
+		return oldURI;
+	}
+
+	/**
+	 * @param oldURI
+	 *            the oldURI to set
+	 */
+	public void setOldURI(URI oldURI) {
+		this.oldURI = oldURI;
+	}
+
+	/**
+	 * @return the newURI
+	 */
+	public URI getNewURI() {
+		return newURI;
+	}
+
+	/**
+	 * @param newURI
+	 *            the newURI to set
+	 */
+	public void setNewURI(URI newURI) {
+		this.newURI = newURI;
+	}
+
+	public Resource getNewResource() {
+		// Get the resource of the new URI on the left side
+		return demandResource(getNewURI(), LEFT, true);
+	}
+
+	public Resource getOldResource() {
+		// Get the resource of the old URI on the left side
+		return demandResource(getOldURI(), LEFT, false);
+	}
+
+	/**
+	 * Obtains the specified resource on the given {@code side} of the match.
+	 * 
+	 * @param uri
+	 *            the resource URI to get
+	 * @param side
+	 *            the side of the comparison in which to get the refactored resource
+	 * @param create
+	 *            whether to create the resource if it doesn't exist (e.g., for merging into it)
+	 * @return the resource, or {@code null} if it doesn't exist and is not {@code create}d
+	 */
+	protected Resource demandResource(URI uri, DifferenceSource side, boolean create) {
+		EObject context = MatchUtil.getMatchedObject(getMatch(), side);
+		ResourceSet rset = context.eResource().getResourceSet();
+
+		Resource result = rset.getResource(uri, false);
+		if (result == null) {
+			if (rset.getURIConverter().exists(uri, null)) {
+				result = rset.getResource(uri, true);
+			} else if (create) {
+				result = rset.createResource(uri);
+			}
+		}
+
+		return result;
+	}
+
+	//
+	// Diff protocol delegation
+	//
+
+	public DifferenceSource getSource() {
+		return rac.getSource();
+	}
+
+	public DifferenceKind getKind() {
+		return rac.getKind();
+	}
+
+	public DifferenceState getState() {
+		return rac.getState();
+	}
+
+	public Match getMatch() {
+		return rac.getMatch();
+	}
+
+	public EList<Diff> getRequiredBy() {
+		return rac.getRequiredBy();
+	}
+
+	//
+	// Adapter protocol
+	//
+
+	public Notifier getTarget() {
+		return rac;
+	}
+
+	public void setTarget(Notifier newTarget) {
+		if (newTarget != null && newTarget != rac) {
+			throw new IllegalArgumentException("attempt to attach to another object"); //$NON-NLS-1$
+		}
+	}
+
+	public boolean isAdapterForType(Object type) {
+		return type == TYPE;
+	}
+
+	public void notifyChanged(Notification notification) {
+		// Pass
+	}
+}
diff --git a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringMerger.java b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringMerger.java
index 66afb05..4281217 100644
--- a/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringMerger.java
+++ b/plugins/compare/bundles/org.eclipse.papyrus.compare.uml2/src/org/eclipse/papyrus/compare/uml2/internal/postprocessor/ResourceRefactoringMerger.java
@@ -12,11 +12,8 @@
 package org.eclipse.papyrus.compare.uml2.internal.postprocessor;
 
 import static org.eclipse.emf.compare.utils.MatchUtil.getMatchedObject;
-import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusPostProcessor.IS_RESOURCE_REFACTORING_MOVE;
-import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusPostProcessor.IS_STEREOTYPE_APPLICATION_RESOURCE_MOVE;
-import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.getResource;
 import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.index;
-import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusResourceIndex.opposite;
+import static org.eclipse.papyrus.compare.uml2.internal.postprocessor.ResourceRefactoringChange.isResourceRefactoringChange;
 
 import java.lang.reflect.Field;
 import java.util.Collection;
@@ -29,24 +26,22 @@
 import org.eclipse.emf.compare.DifferenceSource;
 import org.eclipse.emf.compare.Match;
 import org.eclipse.emf.compare.MatchResource;
-import org.eclipse.emf.compare.ResourceAttachmentChange;
-import org.eclipse.emf.compare.merge.ResourceAttachmentChangeMerger;
+import org.eclipse.emf.compare.merge.AbstractMerger;
 import org.eclipse.emf.compare.merge.ResourceChangeAdapter;
-import org.eclipse.emf.compare.uml2.internal.postprocessor.util.UMLCompareUtil;
-import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.papyrus.compare.uml2.internal.UMLPapyrusComparePlugin;
-import org.eclipse.uml2.uml.Element;
 
 /**
- * A specialized merger for the {@link ResourceAttachmentChange}s in resources that are refactored (renamed or
- * moved) and which, therefore, are not actually logically moving those objects.
+ * A specialized merger for the {@link ResourceRefactoringChange}s in matches of root objects of resources
+ * that are refactored (URIs changed by rename or move) and which, therefore, are not actually logically
+ * moving those root objects. These changes therefore replace {@code ResourceAttachmentChange}s computed by
+ * the diff engine.
  *
  * @author Christian W. Damus
  */
-public class ResourceRefactoringMerger extends ResourceAttachmentChangeMerger {
+public class ResourceRefactoringMerger extends AbstractMerger {
 
 	/**
 	 * Initializes me.
@@ -57,74 +52,45 @@
 
 	@Override
 	public boolean isMergerFor(Diff target) {
-		return IS_STEREOTYPE_APPLICATION_RESOURCE_MOVE.apply(target)
-				|| IS_RESOURCE_REFACTORING_MOVE.apply(target);
+		return isResourceRefactoringChange(target);
 	}
 
 	@Override
-	protected Resource findOrCreateTargetResource(Match match, boolean rightToLeft) {
-		DifferenceSource targetSide = rightToLeft ? DifferenceSource.LEFT : DifferenceSource.RIGHT;
-		EObject movedObject = getMatchedObject(match, targetSide);
-
-		if (movedObject instanceof Element) {
-			// This is not the stereotype application case
-			return super.findOrCreateTargetResource(match, rightToLeft);
-
-		} else {
-			// We were moved to another resource. If our base element was, also, then
-			// we should be moved to its resource regardless
-
-			Element baseElement = UMLCompareUtil.getBaseElement(movedObject);
-			if (baseElement != null) {
-				return baseElement.eResource();
-			}
-		}
-
-		return super.findOrCreateTargetResource(match, rightToLeft);
+	protected void accept(Diff diff, boolean rightToLeft) {
+		refactorResource(ResourceRefactoringChange.get(diff), rightToLeft);
 	}
 
 	@Override
-	protected void move(ResourceAttachmentChange diff, boolean rightToLeft) {
-		Match match = diff.getMatch();
+	protected void reject(Diff diff, boolean rightToLeft) {
+		refactorResource(ResourceRefactoringChange.get(diff), !rightToLeft);
+	}
 
-		Resource left = match.getLeft().eResource();
-		Resource right = match.getRight().eResource();
+	protected void refactorResource(ResourceRefactoringChange diff, boolean rightToLeft) {
+		Resource newResource = diff.getNewResource();
+		Resource oldResource = diff.getOldResource();
 
-		super.move(diff, rightToLeft);
+		if (oldResource != null) {
+			Match match = diff.getMatch();
+			DifferenceSource side = rightToLeft ? DifferenceSource.LEFT : DifferenceSource.RIGHT;
+			ResourceSet rset = newResource.getResourceSet();
 
-		if (IS_RESOURCE_REFACTORING_MOVE.apply(diff)) {
-			// We've moved the UML element. Bring along all stereotype applications
-			// and other related content and delete the originating resources
 			PapyrusResourceIndex index = index(match);
+			MatchResource newMatch = index.getMatch(getMatchedObject(match, side).eResource());
 
-			if (rightToLeft) {
-				MatchResource leftMatch = index.getMatch(left);
-				Resource newLeft = demandResource(leftMatch, DifferenceSource.LEFT);
-				newLeft.getContents().addAll(left.getContents());
-				markForDeletion(left);
+			// We've implicitly moved the UML content. Bring along anything that other
+			// RACs moved into the old resource and then delete it
+			newResource.getContents().addAll(oldResource.getContents());
+			markForDeletion(oldResource);
 
-				for (Map.Entry<String, MatchResource> next : index.getGroup(leftMatch, DifferenceSource.LEFT)
-						.entrySet()) {
-					if (next.getValue() != leftMatch) {
-						left = next.getValue().getLeft();
-						newLeft = demandResource(next.getValue(), DifferenceSource.LEFT);
-						newLeft.getContents().addAll(left.getContents());
-						markForDeletion(left);
-					}
-				}
-			} else {
-				MatchResource rightMatch = index.getMatch(right);
-				Resource newRight = demandResource(rightMatch, DifferenceSource.RIGHT);
-				newRight.getContents().addAll(right.getContents());
-				markForDeletion(right);
+			// And process the other resources in the same group, to ensure their refactoring
+			for (Map.Entry<String, MatchResource> next : index.getGroup(newMatch, side).entrySet()) {
+				if (next.getValue() != newMatch) {
+					newResource = demandResource(companion(diff.getNewURI(), next.getKey()), rset, true);
+					oldResource = demandResource(companion(diff.getOldURI(), next.getKey()), rset, false);
 
-				for (Map.Entry<String, MatchResource> next : index
-						.getGroup(rightMatch, DifferenceSource.RIGHT).entrySet()) {
-					if (next.getValue() != rightMatch) {
-						right = next.getValue().getRight();
-						newRight = demandResource(next.getValue(), DifferenceSource.RIGHT);
-						newRight.getContents().addAll(right.getContents());
-						markForDeletion(right);
+					if (oldResource != null) {
+						newResource.getContents().addAll(oldResource.getContents());
+						markForDeletion(oldResource);
 					}
 				}
 			}
@@ -159,25 +125,39 @@
 	}
 
 	/**
-	 * Obtains the new (refactored) resource on the given {@code side} of the comparison, based on the URI of
-	 * the resource opposite to it in the {@code match}. The resulting resource is created if it does not yet
-	 * exist in the resource set on this {@code side}.
+	 * Obtains the specified resource on the given {@code side} of the match.
 	 * 
-	 * @param match
-	 *            a resource match
-	 * @param side
-	 *            the side of the comparison in which to get the refactored resource
-	 * @return the refactored resource
+	 * @param uri
+	 *            the resource URI to get
+	 * @param rset
+	 *            the resource set on the merge target side in which to get the resource
+	 * @param create
+	 *            whether to create the resource if it doesn't exist (e.g., for merging into it)
+	 * @return the resource, or {@code null} if it doesn't exist and is not {@code create}d
 	 */
-	protected Resource demandResource(MatchResource match, DifferenceSource side) {
-		ResourceSet rset = getResource(match, side).getResourceSet();
-		URI uri = getResource(match, opposite(side)).getURI();
-
+	protected Resource demandResource(URI uri, ResourceSet rset, boolean create) {
 		Resource result = rset.getResource(uri, false);
 		if (result == null) {
-			result = rset.createResource(uri);
+			if (rset.getURIConverter().exists(uri, null)) {
+				result = rset.getResource(uri, true);
+			} else if (create) {
+				result = rset.createResource(uri);
+			}
 		}
 
 		return result;
 	}
+
+	/**
+	 * Compute the companion resource URI of a URI that has the given file extension.
+	 * 
+	 * @param uri
+	 *            the base URI
+	 * @param fileExtension
+	 *            the file extension of the companion
+	 * @return the companion URI
+	 */
+	static URI companion(URI uri, String fileExtension) {
+		return uri.trimFileExtension().appendFileExtension(fileExtension);
+	}
 }
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/META-INF/MANIFEST.MF b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/META-INF/MANIFEST.MF
index d50cde2..362bcd7 100644
--- a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/META-INF/MANIFEST.MF
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/META-INF/MANIFEST.MF
@@ -20,5 +20,6 @@
  org.eclipse.emf.compare.ide.ui.tests.framework,
  org.mockito;bundle-version="1.8.0",
  org.hamcrest;bundle-version="1.1.0",
- org.eclipse.emf.common;bundle-version="2.11.0"
+ org.eclipse.emf.common;bundle-version="2.11.0",
+ org.eclipse.papyrus.compare.uml2;bundle-version="2.5.1"
 Import-Package: org.eclipse.emf.compare.ide.ui.tests
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/AbstractGitMergeTestCase.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/AbstractGitMergeTestCase.java
index 65d1257..1176870 100644
--- a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/AbstractGitMergeTestCase.java
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/AbstractGitMergeTestCase.java
@@ -47,6 +47,7 @@
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.util.FileUtils;
@@ -350,8 +351,18 @@
 		final Iterable<File> filesOfInterest = filter(getAllContainedFiles(workingDirectory),
 				and(IS_EXISTING_FILE, getFileOfInterestFilter()));
 		final Iterable<URI> urisOfInterest = transform(filesOfInterest, toUri());
+
+		// On different OS platforms and/or different computer systems, the order in
+		// which the files are gathered from the git working directory is variable.
+		// In case of sub-model units, be sure to resolve all proxies first, so that
+		// the unit linkages are available for test cases that expect to find them
 		for (URI uriOfInterest : urisOfInterest) {
-			final Resource resource = resourceSet.getResource(uriOfInterest, true);
+			resourceSet.getResource(uriOfInterest, true);
+		}
+		EcoreUtil.resolveAll(resourceSet);
+
+		for (URI uriOfInterest : urisOfInterest) {
+			final Resource resource = resourceSet.getResource(uriOfInterest, false);
 			validateResult(resource);
 		}
 	}
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename1GitMergeTest.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename1GitMergeTest.java
index a63e873..55201e3 100644
--- a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename1GitMergeTest.java
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename1GitMergeTest.java
@@ -43,8 +43,6 @@
  * <dd>The sub-model unit package is renamed, along with all of the sub-unit resources to match the new
  * package name.</dd>
  * </dl>
- *
- * @author Philip Langer <planger@eclipsesource.com>
  */
 @SuppressWarnings("nls")
 public class ResourceAttachmentChangeRename1GitMergeTest extends AbstractGitMergeTestCase {
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename2GitMergeTest.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename2GitMergeTest.java
index 95d71f3..0256606 100644
--- a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename2GitMergeTest.java
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename2GitMergeTest.java
@@ -22,8 +22,8 @@
 import org.eclipse.emf.ecore.resource.Resource;
 
 /**
- * Tests the renaming of a UML Package sub-model that is resobed on another branch. This scenario contains two
- * diagrams, one for the root of the model and another for the extracted package.
+ * Tests the renaming of a UML Package sub-model that is resorbed on another branch. This scenario contains
+ * two diagrams, one for the root of the model and another for the extracted package.
  * <dl>
  * <dt>Origin:</dt>
  * <dd>A class diagram in the root model showing a package containing a class. This package is a sub-model
@@ -34,8 +34,6 @@
  * <dd>The sub-model unit package is renamed, along with all of the sub-unit resources to match the new
  * package name.</dd>
  * </dl>
- *
- * @author Philip Langer <planger@eclipsesource.com>
  */
 @SuppressWarnings("nls")
 
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename3GitMergeTest.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename3GitMergeTest.java
index e62028f..a3f17b5 100644
--- a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename3GitMergeTest.java
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename3GitMergeTest.java
@@ -46,8 +46,6 @@
  * <dd>The sub-model unit package is renamed, along with all of the sub-unit resources to match the new
  * package name.</dd>
  * </dl>
- *
- * @author Philip Langer <planger@eclipsesource.com>
  */
 @SuppressWarnings("nls")
 public class ResourceAttachmentChangeRename3GitMergeTest extends AbstractGitMergeTestCase {
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename4GitMergeTest.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename4GitMergeTest.java
new file mode 100644
index 0000000..61bd0a1
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename4GitMergeTest.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (C) 2015, 2018 EclipseSource Munich Gmbh 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Philip Langer - initial API and implementation
+ *     Christian W. Damus - bug 529217
+ *******************************************************************************/
+package org.eclipse.papyrus.compare.diagram.tests.egit;
+
+import static java.util.Arrays.asList;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.any;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.everyItem;
+import static org.hamcrest.Matchers.hasItem;
+
+import java.io.File;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Tests the renaming of a UML Package sub-model that has stereotyped elements moved out of it on another
+ * branch. This scenario contains two diagrams, one for the root of the model and another for the extracted
+ * package.
+ * <dl>
+ * <dt>Origin:</dt>
+ * <dd>A class diagram in the root model showing a package containing a class and two other stereotyped
+ * elements. This package is a sub-model unit that has its own diagram showing the content of the package,
+ * being the class and those stereotyped elements.</dd>
+ * <dt>Left:</dt>
+ * <dd>The two stereotype elements are moved out of the sub-unit package into the root package. The layout of
+ * both diagrams is changed: in the root package to move the two shapes out of the nested package shape, and
+ * in the sub-unit package's diagram to delete the shapes for the two elements.</dd>
+ * <dt>Right:</dt>
+ * <dd>The sub-model unit package is renamed, along with all of the sub-unit resources to match the new
+ * package name.</dd>
+ * </dl>
+ */
+@SuppressWarnings("nls")
+public class ResourceAttachmentChangeRename4GitMergeTest extends AbstractGitMergeTestCase {
+
+	private static final String TEST_SCENARIO_PATH = "testmodels/resourceattachmentchange/rename4/";
+
+	private static final String SUBUNIT_UML = "Subunit1.uml";
+
+	private static final String MODEL_UML = "model.uml";
+
+	@Override
+	protected String getTestScenarioPath() {
+		return TEST_SCENARIO_PATH;
+	}
+
+	@Override
+	protected boolean shouldValidate(File file) {
+		return file.getName().equals(MODEL_UML) || file.getName().equals(SUBUNIT_UML);
+	}
+
+	@Override
+	protected void validateResult() throws Exception {
+		assertThat("conflicts remain", noConflict());
+
+		assertThat(asList("model.di", "model.notation", MODEL_UML, //
+				"Subunit1.di", "Subunit1.notation", SUBUNIT_UML), //
+				everyItem(fileExists()));
+
+		assertThat(asList("Package1.di", "Package1.notation", "Package1.uml"), //
+				everyItem(not(fileExists())));
+	}
+
+	@Override
+	protected void validateResult(Resource resource) throws Exception {
+		switch (resource.getURI().lastSegment()) {
+			case MODEL_UML:
+				checkModelResource(resource);
+				break;
+			case SUBUNIT_UML:
+				checkSubunitResource(resource);
+				break;
+		}
+	}
+
+	private void checkModelResource(Resource resource) {
+		assertThat(resource.getContents(), hasItem(any(Model.class)));
+		final Model model = (Model)EcoreUtil.getObjectByType(resource.getContents(),
+				UMLPackage.Literals.MODEL);
+
+		assertThat(model.getNestedPackages(), hasItem(any(Package.class)));
+		final Package package_ = model.getNestedPackages().get(0);
+
+		checkLeftChanges(package_);
+		checkRightChanges(package_);
+	}
+
+	private void checkLeftChanges(Package package_) {
+		final Model model = (Model)package_.getNestingPackage();
+		Type strings = model.getOwnedType("Strings");
+		assertThat(strings, stereotypedAs("Utility"));
+		assertThat(strings.getStereotypeApplications(), everyItem(storedIn(strings.eResource())));
+		Package jface = model.getNestedPackage("jface");
+		assertThat(jface, stereotypedAs("Framework"));
+		assertThat(jface.getStereotypeApplications(), everyItem(storedIn(jface.eResource())));
+
+		assertThat(package_.getOwnedTypes(), not(empty()));
+		assertThat(package_.getOwnedType("Strings"), nullValue());
+		assertThat(package_.getNestedPackage("jface"), nullValue());
+	}
+
+	private void checkRightChanges(Package package_) {
+		assertThat(package_.getName(), is("Subunit1"));
+	}
+
+	private void checkSubunitResource(Resource resource) {
+		assertThat(resource.getContents(), hasItem(any(Package.class)));
+		final Package package_ = (Package)EcoreUtil.getObjectByType(resource.getContents(),
+				UMLPackage.Literals.PACKAGE);
+
+		checkLeftChanges(package_);
+		checkRightChanges(package_);
+	}
+}
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename5GitMergeTest.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename5GitMergeTest.java
new file mode 100644
index 0000000..e12be33
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/egit/ResourceAttachmentChangeRename5GitMergeTest.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (C) 2015, 2018 EclipseSource Munich Gmbh 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Philip Langer - initial API and implementation
+ *     Christian W. Damus - bug 529217
+ *******************************************************************************/
+package org.eclipse.papyrus.compare.diagram.tests.egit;
+
+import static java.util.Arrays.asList;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.everyItem;
+
+import java.io.File;
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * Tests the renaming of a UML Package sub-model on both sides of a merge to different URIs.
+ * <dl>
+ * <dt>Origin:</dt>
+ * <dd>A class diagram in the root model showing a package containing a class and two other stereotyped
+ * elements. This package is a sub-model unit that has its own diagram showing the content of the package,
+ * being the class and those stereotyped elements.</dd>
+ * <dt>Left:</dt>
+ * <dd>The sub-model unit resources to are renamed.</dd>
+ * <dt>Right:</dt>
+ * <dd>The sub-model unit package is renamed, along with all of the sub-unit resources to match the new
+ * package name, resulting in resource names (URIs) that are different to the left side.</dd>
+ * </dl>
+ */
+@SuppressWarnings("nls")
+public class ResourceAttachmentChangeRename5GitMergeTest extends AbstractGitMergeTestCase {
+	private static final String TEST_SCENARIO_PATH = "testmodels/resourceattachmentchange/rename5/";
+
+	private static final String SUBUNIT_UML = "Subunit1.uml";
+
+	private static final String NEWNAME_UML = "NewName.uml";
+
+	@Override
+	protected String getTestScenarioPath() {
+		return TEST_SCENARIO_PATH;
+	}
+
+	@Override
+	protected boolean shouldValidate(File file) {
+		return false; // There are no mergeable changes to verify in any file
+	}
+
+	@Override
+	protected void validateResult() throws Exception {
+		assertThat("no conflicts", isConflicting());
+
+		assertThat(asList("NewName.di", "NewName.notation", NEWNAME_UML, //
+				"Subunit1.di", "Subunit1.notation", SUBUNIT_UML), //
+				everyItem(isConflicted()));
+	}
+
+	@Override
+	protected void validateResult(Resource resource) throws Exception {
+		// Pass
+	}
+}
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/suite/PapyrusGitTests.java b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/suite/PapyrusGitTests.java
index 58f0c89..988c198 100644
--- a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/suite/PapyrusGitTests.java
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/src/org/eclipse/papyrus/compare/diagram/tests/suite/PapyrusGitTests.java
@@ -28,6 +28,8 @@
 import org.eclipse.papyrus.compare.diagram.tests.egit.ResourceAttachmentChangeRename1GitMergeTest;
 import org.eclipse.papyrus.compare.diagram.tests.egit.ResourceAttachmentChangeRename2GitMergeTest;
 import org.eclipse.papyrus.compare.diagram.tests.egit.ResourceAttachmentChangeRename3GitMergeTest;
+import org.eclipse.papyrus.compare.diagram.tests.egit.ResourceAttachmentChangeRename4GitMergeTest;
+import org.eclipse.papyrus.compare.diagram.tests.egit.ResourceAttachmentChangeRename5GitMergeTest;
 import org.eclipse.papyrus.compare.diagram.tests.egit.StereotypeApplicationsInSubunitsTest;
 import org.eclipse.papyrus.compare.diagram.tests.egit.StereotypeConflictTest;
 import org.eclipse.papyrus.compare.diagram.tests.egit.mergeresolution.MergeResolutionManagerTest;
@@ -57,6 +59,8 @@
 		ResourceAttachmentChangeRename1GitMergeTest.class, //
 		ResourceAttachmentChangeRename2GitMergeTest.class, //
 		ResourceAttachmentChangeRename3GitMergeTest.class, //
+		ResourceAttachmentChangeRename4GitMergeTest.class, //
+		ResourceAttachmentChangeRename5GitMergeTest.class, //
 })
 public class PapyrusGitTests {
 
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.notation
new file mode 100644
index 0000000..bead532
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.notation
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_gqBjYGIWEeWaI82ZiBQcnA" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_hg79QGIWEeWaI82ZiBQcnA" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycGIWEeWaI82ZiBQcnA" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycWIWEeWaI82ZiBQcnA" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_hg9ycmIWEeWaI82ZiBQcnA" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg9yc2IWEeWaI82ZiBQcnA" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg9ydGIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg9ydWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg9ydmIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg9yd2IWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZgGIWEeWaI82ZiBQcnA" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZgWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-ZgmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-Zg2IWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZhGIWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZhWIWEeWaI82ZiBQcnA" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZhmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-Zh2IWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-ZiGIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZiWIWEeWaI82ZiBQcnA"/>
+    </children>
+    <element xmi:type="uml:Class" href="Package1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg79QWIWEeWaI82ZiBQcnA" x="100" y="100"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_gqBjYWIWEeWaI82ZiBQcnA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_gqBjYmIWEeWaI82ZiBQcnA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PGOiUPY9EeeID_yQhJd40g" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.uml
new file mode 100644
index 0000000..4568041
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/Package1.uml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Package xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_3BK90GIREeWuYNIEaw6oIA" name="Package1">
+  <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3s5ZEOqDEeeGNpM5WA6vzA" source="http://www.eclipse.org/papyrus/2016/resource/shard">
+    <references xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </eAnnotations>
+  <packagedElement xmi:type="uml:Class" xmi:id="_Tvs-0GISEeWuYNIEaw6oIA" name="Class1"/>
+</uml:Package>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.notation
new file mode 100644
index 0000000..2af4155
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.notation
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0p_EAGIREeWuYNIEaw6oIA" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_3BSSkGIREeWuYNIEaw6oIA" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_3BUHwGIREeWuYNIEaw6oIA" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_3BUHwWIREeWuYNIEaw6oIA" type="Package_PackagedElementCompartment">
+      <children xmi:type="notation:Shape" xmi:id="_Tv06oGISEeWuYNIEaw6oIA" type="Class_Shape_CN">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06omISEeWuYNIEaw6oIA" type="Class_NameLabel_CN"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06o2ISEeWuYNIEaw6oIA" type="Class_FloatingNameLabel_CN">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_Tv06pGISEeWuYNIEaw6oIA" y="5"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1hsGISEeWuYNIEaw6oIA" type="Class_AttributeCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hsWISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hsmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hs2ISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1htGISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1htWISEeWuYNIEaw6oIA" type="Class_OperationCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1htmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1ht2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1huGISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1huWISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1humISEeWuYNIEaw6oIA" type="Class_NestedClassifierCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hu2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hvGISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hvWISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1hvmISEeWuYNIEaw6oIA"/>
+        </children>
+        <element xmi:type="uml:Class" href="Package1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv06oWISEeWuYNIEaw6oIA" x="9" y="8"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_3BUHwmIREeWuYNIEaw6oIA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BUHw2IREeWuYNIEaw6oIA"/>
+    </children>
+    <element xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BSSkWIREeWuYNIEaw6oIA" x="85" y="84" width="476" height="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_Yxn_AOsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_Yxn_AesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxomEOsYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="model.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Yxn_AusYEeeP1-vgK6VsNg" x="342" y="359"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_g19o5OsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_g19o5esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g19o5-sYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="model.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_g19o5usYEeeP1-vgK6VsNg" x="489" y="349"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_WhIjEOsYEeeP1-vgK6VsNg" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYOsYEeeP1-vgK6VsNg" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYesYEeeP1-vgK6VsNg" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_WhLmYusYEeeP1-vgK6VsNg" y="15"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNcOsYEeeP1-vgK6VsNg" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNcesYEeeP1-vgK6VsNg"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNcusYEeeP1-vgK6VsNg"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNc-sYEeeP1-vgK6VsNg"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNdOsYEeeP1-vgK6VsNg"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNdesYEeeP1-vgK6VsNg" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNdusYEeeP1-vgK6VsNg"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNd-sYEeeP1-vgK6VsNg"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNeOsYEeeP1-vgK6VsNg"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNeesYEeeP1-vgK6VsNg"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNeusYEeeP1-vgK6VsNg" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNe-sYEeeP1-vgK6VsNg"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNfOsYEeeP1-vgK6VsNg"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNfesYEeeP1-vgK6VsNg"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNfusYEeeP1-vgK6VsNg"/>
+    </children>
+    <element xmi:type="uml:Class" href="model.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhIjEesYEeeP1-vgK6VsNg" x="80" y="300"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_cs7-AOsYEeeP1-vgK6VsNg" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_cs8lEOsYEeeP1-vgK6VsNg" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_cs8lEesYEeeP1-vgK6VsNg" type="Package_PackagedElementCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_cs8lEusYEeeP1-vgK6VsNg"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs8lE-sYEeeP1-vgK6VsNg"/>
+    </children>
+    <element xmi:type="uml:Package" href="model.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs7-AesYEeeP1-vgK6VsNg" x="200" y="300"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_0p_EAWIREeWuYNIEaw6oIA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_0p_EAmIREeWuYNIEaw6oIA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PmS34OsYEeeP1-vgK6VsNg" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_Yxs3gOsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_WhIjEOsYEeeP1-vgK6VsNg" target="_Yxn_AOsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_Yxs3gesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxuFousYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="model.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Yxs3gusYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoOsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoesYEeeP1-vgK6VsNg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_g19o6OsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_cs7-AOsYEeeP1-vgK6VsNg" target="_g19o5OsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_g19o6esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g1-P8usYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="model.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_g19o6usYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8OsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8esYEeeP1-vgK6VsNg"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.uml
new file mode 100644
index 0000000..1e4fcbc
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/left/model.uml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:standard="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+  <uml:Model xmi:id="_0lgMoGIREeWuYNIEaw6oIA" name="RootElement">
+    <packagedElement xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <packagedElement xmi:type="uml:Class" xmi:id="_WhDDgOsYEeeP1-vgK6VsNg" name="Strings"/>
+    <packagedElement xmi:type="uml:Package" xmi:id="_cr1x0OsYEeeP1-vgK6VsNg" name="jface"/>
+    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_U-AjcOsYEeeP1-vgK6VsNg">
+      <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_U-CYoOsYEeeP1-vgK6VsNg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+        <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+      </eAnnotations>
+      <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+    </profileApplication>
+  </uml:Model>
+  <standard:Utility xmi:id="_YxA7AOsYEeeP1-vgK6VsNg" base_Class="_WhDDgOsYEeeP1-vgK6VsNg"/>
+  <standard:Framework xmi:id="_g1o4wOsYEeeP1-vgK6VsNg" base_Package="_cr1x0OsYEeeP1-vgK6VsNg"/>
+</xmi:XMI>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.notation
new file mode 100644
index 0000000..ccd6103
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.notation
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_gqBjYGIWEeWaI82ZiBQcnA" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_hg79QGIWEeWaI82ZiBQcnA" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycGIWEeWaI82ZiBQcnA" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycWIWEeWaI82ZiBQcnA" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_hg9ycmIWEeWaI82ZiBQcnA" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg9yc2IWEeWaI82ZiBQcnA" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg9ydGIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg9ydWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg9ydmIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg9yd2IWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZgGIWEeWaI82ZiBQcnA" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZgWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-ZgmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-Zg2IWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZhGIWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZhWIWEeWaI82ZiBQcnA" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZhmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-Zh2IWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-ZiGIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZiWIWEeWaI82ZiBQcnA"/>
+    </children>
+    <element xmi:type="uml:Class" href="Package1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg79QWIWEeWaI82ZiBQcnA" x="100" y="100"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PyZEwPY9EeeID_yQhJd40g" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUPY9EeeID_yQhJd40g" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUfY9EeeID_yQhJd40g" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_PyekUvY9EeeID_yQhJd40g" y="15"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLYPY9EeeID_yQhJd40g" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLYfY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLYvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLY_Y9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLZPY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLZfY9EeeID_yQhJd40g" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLZvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLZ_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLaPY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLafY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLavY9EeeID_yQhJd40g" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLa_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLbPY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLbfY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLbvY9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyZEwfY9EeeID_yQhJd40g" x="100" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PynHMPY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PynHMfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PynHM_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PynHMvY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzEaMPY9EeeID_yQhJd40g" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PzFBQPY9EeeID_yQhJd40g" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PzFBQfY9EeeID_yQhJd40g" type="Package_PackagedElementCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PzFBQvY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzFBQ_Y9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzEaMfY9EeeID_yQhJd40g" x="240" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzKg0PY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PzKg0fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg0_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzKg0vY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_gqBjYWIWEeWaI82ZiBQcnA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_gqBjYmIWEeWaI82ZiBQcnA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PGOiUPY9EeeID_yQhJd40g" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_PynuQPY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PyZEwPY9EeeID_yQhJd40g" target="_PynHMPY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PynuQfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PyoVUvY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PynuQvY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUPY9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUfY9EeeID_yQhJd40g"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_PzKg1PY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PzEaMPY9EeeID_yQhJd40g" target="_PzKg0PY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PzKg1fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg2fY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PzKg1vY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg1_Y9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg2PY9EeeID_yQhJd40g"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.uml
new file mode 100644
index 0000000..c79211b
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/Package1.uml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:standard="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+  <uml:Package xmi:id="_3BK90GIREeWuYNIEaw6oIA" name="Package1">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3s5ZEOqDEeeGNpM5WA6vzA" source="http://www.eclipse.org/papyrus/2016/resource/shard">
+      <references xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+    </eAnnotations>
+    <packagedElement xmi:type="uml:Class" xmi:id="_Tvs-0GISEeWuYNIEaw6oIA" name="Class1"/>
+    <packagedElement xmi:type="uml:Class" xmi:id="_WhDDgOsYEeeP1-vgK6VsNg" name="Strings"/>
+    <packagedElement xmi:type="uml:Package" xmi:id="_cr1x0OsYEeeP1-vgK6VsNg" name="jface"/>
+  </uml:Package>
+  <standard:Utility xmi:id="_YxA7AOsYEeeP1-vgK6VsNg" base_Class="_WhDDgOsYEeeP1-vgK6VsNg"/>
+  <standard:Framework xmi:id="_g1o4wOsYEeeP1-vgK6VsNg" base_Package="_cr1x0OsYEeeP1-vgK6VsNg"/>
+</xmi:XMI>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.notation
new file mode 100644
index 0000000..3736abd
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.notation
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0p_EAGIREeWuYNIEaw6oIA" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_3BSSkGIREeWuYNIEaw6oIA" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_3BUHwGIREeWuYNIEaw6oIA" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_3BUHwWIREeWuYNIEaw6oIA" type="Package_PackagedElementCompartment">
+      <children xmi:type="notation:Shape" xmi:id="_Tv06oGISEeWuYNIEaw6oIA" type="Class_Shape_CN">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06omISEeWuYNIEaw6oIA" type="Class_NameLabel_CN"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06o2ISEeWuYNIEaw6oIA" type="Class_FloatingNameLabel_CN">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_Tv06pGISEeWuYNIEaw6oIA" y="5"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1hsGISEeWuYNIEaw6oIA" type="Class_AttributeCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hsWISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hsmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hs2ISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1htGISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1htWISEeWuYNIEaw6oIA" type="Class_OperationCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1htmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1ht2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1huGISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1huWISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1humISEeWuYNIEaw6oIA" type="Class_NestedClassifierCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hu2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hvGISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hvWISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1hvmISEeWuYNIEaw6oIA"/>
+        </children>
+        <element xmi:type="uml:Class" href="Package1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv06oWISEeWuYNIEaw6oIA" x="9" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_WhIjEOsYEeeP1-vgK6VsNg" type="Class_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYOsYEeeP1-vgK6VsNg" type="Class_NameLabel"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYesYEeeP1-vgK6VsNg" type="Class_FloatingNameLabel">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_WhLmYusYEeeP1-vgK6VsNg" y="15"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNcOsYEeeP1-vgK6VsNg" type="Class_AttributeCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNcesYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNcusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNc-sYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNdOsYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNdesYEeeP1-vgK6VsNg" type="Class_OperationCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNdusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNd-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNeOsYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNeesYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNeusYEeeP1-vgK6VsNg" type="Class_NestedClassifierCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNe-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNfOsYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNfesYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNfusYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhIjEesYEeeP1-vgK6VsNg" x="129" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_cs7-AOsYEeeP1-vgK6VsNg" type="Package_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_cs8lEOsYEeeP1-vgK6VsNg" type="Package_NameLabel"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_cs8lEesYEeeP1-vgK6VsNg" type="Package_PackagedElementCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_cs8lEusYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs8lE-sYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs7-AesYEeeP1-vgK6VsNg" x="249" y="8"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_3BUHwmIREeWuYNIEaw6oIA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BUHw2IREeWuYNIEaw6oIA"/>
+    </children>
+    <element xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BSSkWIREeWuYNIEaw6oIA" x="85" y="84" width="476" height="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_Yxn_AOsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_Yxn_AesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxomEOsYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Yxn_AusYEeeP1-vgK6VsNg" x="342" y="359"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_g19o5OsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_g19o5esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g19o5-sYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_g19o5usYEeeP1-vgK6VsNg" x="489" y="349"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_0p_EAWIREeWuYNIEaw6oIA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_0p_EAmIREeWuYNIEaw6oIA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PmS34OsYEeeP1-vgK6VsNg" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_Yxs3gOsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_WhIjEOsYEeeP1-vgK6VsNg" target="_Yxn_AOsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_Yxs3gesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxuFousYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Yxs3gusYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoOsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoesYEeeP1-vgK6VsNg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_g19o6OsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_cs7-AOsYEeeP1-vgK6VsNg" target="_g19o5OsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_g19o6esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g1-P8usYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_g19o6usYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8OsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8esYEeeP1-vgK6VsNg"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.uml
new file mode 100644
index 0000000..c38741a
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/origin/model.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0lgMoGIREeWuYNIEaw6oIA" name="RootElement">
+  <packagedElement xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_U-AjcOsYEeeP1-vgK6VsNg">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_U-CYoOsYEeeP1-vgK6VsNg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+      <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+    </eAnnotations>
+    <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+  </profileApplication>
+</uml:Model>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.notation
new file mode 100644
index 0000000..c267bf8
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.notation
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_gqBjYGIWEeWaI82ZiBQcnA" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_hg79QGIWEeWaI82ZiBQcnA" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycGIWEeWaI82ZiBQcnA" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycWIWEeWaI82ZiBQcnA" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_hg9ycmIWEeWaI82ZiBQcnA" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg9yc2IWEeWaI82ZiBQcnA" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg9ydGIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg9ydWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg9ydmIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg9yd2IWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZgGIWEeWaI82ZiBQcnA" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZgWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-ZgmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-Zg2IWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZhGIWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZhWIWEeWaI82ZiBQcnA" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZhmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-Zh2IWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-ZiGIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZiWIWEeWaI82ZiBQcnA"/>
+    </children>
+    <element xmi:type="uml:Class" href="Subunit1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg79QWIWEeWaI82ZiBQcnA" x="100" y="100"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PyZEwPY9EeeID_yQhJd40g" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUPY9EeeID_yQhJd40g" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUfY9EeeID_yQhJd40g" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_PyekUvY9EeeID_yQhJd40g" y="15"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLYPY9EeeID_yQhJd40g" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLYfY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLYvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLY_Y9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLZPY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLZfY9EeeID_yQhJd40g" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLZvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLZ_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLaPY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLafY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLavY9EeeID_yQhJd40g" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLa_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLbPY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLbfY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLbvY9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyZEwfY9EeeID_yQhJd40g" x="100" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PynHMPY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PynHMfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PynHM_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PynHMvY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzEaMPY9EeeID_yQhJd40g" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PzFBQPY9EeeID_yQhJd40g" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PzFBQfY9EeeID_yQhJd40g" type="Package_PackagedElementCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PzFBQvY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzFBQ_Y9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzEaMfY9EeeID_yQhJd40g" x="240" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzKg0PY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PzKg0fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg0_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzKg0vY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_gqBjYWIWEeWaI82ZiBQcnA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_gqBjYmIWEeWaI82ZiBQcnA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PGOiUPY9EeeID_yQhJd40g" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_PynuQPY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PyZEwPY9EeeID_yQhJd40g" target="_PynHMPY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PynuQfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PyoVUvY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PynuQvY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUPY9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUfY9EeeID_yQhJd40g"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_PzKg1PY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PzEaMPY9EeeID_yQhJd40g" target="_PzKg0PY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PzKg1fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg2fY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PzKg1vY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg1_Y9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg2PY9EeeID_yQhJd40g"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.uml
new file mode 100644
index 0000000..937fa29
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/Subunit1.uml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:standard="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+  <uml:Package xmi:id="_3BK90GIREeWuYNIEaw6oIA" name="Subunit1">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3s5ZEOqDEeeGNpM5WA6vzA" source="http://www.eclipse.org/papyrus/2016/resource/shard">
+      <references xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+    </eAnnotations>
+    <packagedElement xmi:type="uml:Class" xmi:id="_Tvs-0GISEeWuYNIEaw6oIA" name="Class1"/>
+    <packagedElement xmi:type="uml:Class" xmi:id="_WhDDgOsYEeeP1-vgK6VsNg" name="Strings"/>
+    <packagedElement xmi:type="uml:Package" xmi:id="_cr1x0OsYEeeP1-vgK6VsNg" name="jface"/>
+  </uml:Package>
+  <standard:Utility xmi:id="_YxA7AOsYEeeP1-vgK6VsNg" base_Class="_WhDDgOsYEeeP1-vgK6VsNg"/>
+  <standard:Framework xmi:id="_g1o4wOsYEeeP1-vgK6VsNg" base_Package="_cr1x0OsYEeeP1-vgK6VsNg"/>
+</xmi:XMI>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.notation
new file mode 100644
index 0000000..961fdc5
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.notation
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0p_EAGIREeWuYNIEaw6oIA" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_3BSSkGIREeWuYNIEaw6oIA" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_3BUHwGIREeWuYNIEaw6oIA" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_3BUHwWIREeWuYNIEaw6oIA" type="Package_PackagedElementCompartment">
+      <children xmi:type="notation:Shape" xmi:id="_Tv06oGISEeWuYNIEaw6oIA" type="Class_Shape_CN">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06omISEeWuYNIEaw6oIA" type="Class_NameLabel_CN"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06o2ISEeWuYNIEaw6oIA" type="Class_FloatingNameLabel_CN">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_Tv06pGISEeWuYNIEaw6oIA" y="5"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1hsGISEeWuYNIEaw6oIA" type="Class_AttributeCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hsWISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hsmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hs2ISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1htGISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1htWISEeWuYNIEaw6oIA" type="Class_OperationCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1htmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1ht2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1huGISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1huWISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1humISEeWuYNIEaw6oIA" type="Class_NestedClassifierCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hu2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hvGISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hvWISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1hvmISEeWuYNIEaw6oIA"/>
+        </children>
+        <element xmi:type="uml:Class" href="Subunit1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv06oWISEeWuYNIEaw6oIA" x="9" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_WhIjEOsYEeeP1-vgK6VsNg" type="Class_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYOsYEeeP1-vgK6VsNg" type="Class_NameLabel"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYesYEeeP1-vgK6VsNg" type="Class_FloatingNameLabel">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_WhLmYusYEeeP1-vgK6VsNg" y="15"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNcOsYEeeP1-vgK6VsNg" type="Class_AttributeCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNcesYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNcusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNc-sYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNdOsYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNdesYEeeP1-vgK6VsNg" type="Class_OperationCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNdusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNd-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNeOsYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNeesYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNeusYEeeP1-vgK6VsNg" type="Class_NestedClassifierCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNe-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNfOsYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNfesYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNfusYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhIjEesYEeeP1-vgK6VsNg" x="129" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_cs7-AOsYEeeP1-vgK6VsNg" type="Package_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_cs8lEOsYEeeP1-vgK6VsNg" type="Package_NameLabel"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_cs8lEesYEeeP1-vgK6VsNg" type="Package_PackagedElementCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_cs8lEusYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs8lE-sYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs7-AesYEeeP1-vgK6VsNg" x="249" y="8"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_3BUHwmIREeWuYNIEaw6oIA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BUHw2IREeWuYNIEaw6oIA"/>
+    </children>
+    <element xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BSSkWIREeWuYNIEaw6oIA" x="85" y="84" width="476" height="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_Yxn_AOsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_Yxn_AesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxomEOsYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Yxn_AusYEeeP1-vgK6VsNg" x="342" y="359"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_g19o5OsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_g19o5esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g19o5-sYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_g19o5usYEeeP1-vgK6VsNg" x="489" y="349"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_0p_EAWIREeWuYNIEaw6oIA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_0p_EAmIREeWuYNIEaw6oIA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PmS34OsYEeeP1-vgK6VsNg" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_Yxs3gOsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_WhIjEOsYEeeP1-vgK6VsNg" target="_Yxn_AOsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_Yxs3gesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxuFousYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Yxs3gusYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoOsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoesYEeeP1-vgK6VsNg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_g19o6OsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_cs7-AOsYEeeP1-vgK6VsNg" target="_g19o5OsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_g19o6esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g1-P8usYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_g19o6usYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8OsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8esYEeeP1-vgK6VsNg"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.uml
new file mode 100644
index 0000000..ec03fd2
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename4/right/model.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0lgMoGIREeWuYNIEaw6oIA" name="RootElement">
+  <packagedElement xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_U-AjcOsYEeeP1-vgK6VsNg">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_U-CYoOsYEeeP1-vgK6VsNg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+      <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+    </eAnnotations>
+    <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+  </profileApplication>
+</uml:Model>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.notation
new file mode 100644
index 0000000..815073d
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.notation
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_gqBjYGIWEeWaI82ZiBQcnA" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_hg79QGIWEeWaI82ZiBQcnA" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycGIWEeWaI82ZiBQcnA" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycWIWEeWaI82ZiBQcnA" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_hg9ycmIWEeWaI82ZiBQcnA" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg9yc2IWEeWaI82ZiBQcnA" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg9ydGIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg9ydWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg9ydmIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg9yd2IWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZgGIWEeWaI82ZiBQcnA" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZgWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-ZgmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-Zg2IWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZhGIWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZhWIWEeWaI82ZiBQcnA" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZhmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-Zh2IWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-ZiGIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZiWIWEeWaI82ZiBQcnA"/>
+    </children>
+    <element xmi:type="uml:Class" href="NewName.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg79QWIWEeWaI82ZiBQcnA" x="100" y="100"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PyZEwPY9EeeID_yQhJd40g" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUPY9EeeID_yQhJd40g" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUfY9EeeID_yQhJd40g" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_PyekUvY9EeeID_yQhJd40g" y="15"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLYPY9EeeID_yQhJd40g" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLYfY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLYvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLY_Y9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLZPY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLZfY9EeeID_yQhJd40g" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLZvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLZ_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLaPY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLafY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLavY9EeeID_yQhJd40g" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLa_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLbPY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLbfY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLbvY9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Class" href="NewName.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyZEwfY9EeeID_yQhJd40g" x="100" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PynHMPY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PynHMfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PynHM_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="NewName.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PynHMvY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzEaMPY9EeeID_yQhJd40g" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PzFBQPY9EeeID_yQhJd40g" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PzFBQfY9EeeID_yQhJd40g" type="Package_PackagedElementCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PzFBQvY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzFBQ_Y9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Package" href="NewName.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzEaMfY9EeeID_yQhJd40g" x="240" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzKg0PY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PzKg0fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg0_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="NewName.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzKg0vY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_gqBjYWIWEeWaI82ZiBQcnA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_gqBjYmIWEeWaI82ZiBQcnA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PGOiUPY9EeeID_yQhJd40g" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Package" href="NewName.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Package" href="NewName.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_PynuQPY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PyZEwPY9EeeID_yQhJd40g" target="_PynHMPY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PynuQfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PyoVUvY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="NewName.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PynuQvY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUPY9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUfY9EeeID_yQhJd40g"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_PzKg1PY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PzEaMPY9EeeID_yQhJd40g" target="_PzKg0PY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PzKg1fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg2fY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="NewName.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PzKg1vY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg1_Y9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg2PY9EeeID_yQhJd40g"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.uml
new file mode 100644
index 0000000..c79211b
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/NewName.uml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:standard="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+  <uml:Package xmi:id="_3BK90GIREeWuYNIEaw6oIA" name="Package1">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3s5ZEOqDEeeGNpM5WA6vzA" source="http://www.eclipse.org/papyrus/2016/resource/shard">
+      <references xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+    </eAnnotations>
+    <packagedElement xmi:type="uml:Class" xmi:id="_Tvs-0GISEeWuYNIEaw6oIA" name="Class1"/>
+    <packagedElement xmi:type="uml:Class" xmi:id="_WhDDgOsYEeeP1-vgK6VsNg" name="Strings"/>
+    <packagedElement xmi:type="uml:Package" xmi:id="_cr1x0OsYEeeP1-vgK6VsNg" name="jface"/>
+  </uml:Package>
+  <standard:Utility xmi:id="_YxA7AOsYEeeP1-vgK6VsNg" base_Class="_WhDDgOsYEeeP1-vgK6VsNg"/>
+  <standard:Framework xmi:id="_g1o4wOsYEeeP1-vgK6VsNg" base_Package="_cr1x0OsYEeeP1-vgK6VsNg"/>
+</xmi:XMI>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.notation
new file mode 100644
index 0000000..556e23b
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.notation
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0p_EAGIREeWuYNIEaw6oIA" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_3BSSkGIREeWuYNIEaw6oIA" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_3BUHwGIREeWuYNIEaw6oIA" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_3BUHwWIREeWuYNIEaw6oIA" type="Package_PackagedElementCompartment">
+      <children xmi:type="notation:Shape" xmi:id="_Tv06oGISEeWuYNIEaw6oIA" type="Class_Shape_CN">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06omISEeWuYNIEaw6oIA" type="Class_NameLabel_CN"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06o2ISEeWuYNIEaw6oIA" type="Class_FloatingNameLabel_CN">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_Tv06pGISEeWuYNIEaw6oIA" y="5"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1hsGISEeWuYNIEaw6oIA" type="Class_AttributeCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hsWISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hsmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hs2ISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1htGISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1htWISEeWuYNIEaw6oIA" type="Class_OperationCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1htmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1ht2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1huGISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1huWISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1humISEeWuYNIEaw6oIA" type="Class_NestedClassifierCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hu2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hvGISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hvWISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1hvmISEeWuYNIEaw6oIA"/>
+        </children>
+        <element xmi:type="uml:Class" href="NewName.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv06oWISEeWuYNIEaw6oIA" x="9" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_WhIjEOsYEeeP1-vgK6VsNg" type="Class_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYOsYEeeP1-vgK6VsNg" type="Class_NameLabel"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYesYEeeP1-vgK6VsNg" type="Class_FloatingNameLabel">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_WhLmYusYEeeP1-vgK6VsNg" y="15"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNcOsYEeeP1-vgK6VsNg" type="Class_AttributeCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNcesYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNcusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNc-sYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNdOsYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNdesYEeeP1-vgK6VsNg" type="Class_OperationCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNdusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNd-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNeOsYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNeesYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNeusYEeeP1-vgK6VsNg" type="Class_NestedClassifierCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNe-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNfOsYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNfesYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNfusYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Class" href="NewName.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhIjEesYEeeP1-vgK6VsNg" x="129" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_cs7-AOsYEeeP1-vgK6VsNg" type="Package_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_cs8lEOsYEeeP1-vgK6VsNg" type="Package_NameLabel"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_cs8lEesYEeeP1-vgK6VsNg" type="Package_PackagedElementCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_cs8lEusYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs8lE-sYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Package" href="NewName.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs7-AesYEeeP1-vgK6VsNg" x="249" y="8"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_3BUHwmIREeWuYNIEaw6oIA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BUHw2IREeWuYNIEaw6oIA"/>
+    </children>
+    <element xmi:type="uml:Package" href="NewName.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BSSkWIREeWuYNIEaw6oIA" x="85" y="84" width="476" height="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_Yxn_AOsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_Yxn_AesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxomEOsYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="NewName.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Yxn_AusYEeeP1-vgK6VsNg" x="342" y="359"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_g19o5OsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_g19o5esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g19o5-sYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="NewName.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_g19o5usYEeeP1-vgK6VsNg" x="489" y="349"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_0p_EAWIREeWuYNIEaw6oIA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_0p_EAmIREeWuYNIEaw6oIA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PmS34OsYEeeP1-vgK6VsNg" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_Yxs3gOsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_WhIjEOsYEeeP1-vgK6VsNg" target="_Yxn_AOsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_Yxs3gesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxuFousYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="NewName.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Yxs3gusYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoOsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoesYEeeP1-vgK6VsNg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_g19o6OsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_cs7-AOsYEeeP1-vgK6VsNg" target="_g19o5OsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_g19o6esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g1-P8usYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="NewName.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_g19o6usYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8OsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8esYEeeP1-vgK6VsNg"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.uml
new file mode 100644
index 0000000..1a5d19a
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/left/model.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0lgMoGIREeWuYNIEaw6oIA" name="RootElement">
+  <packagedElement xmi:type="uml:Package" href="NewName.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_U-AjcOsYEeeP1-vgK6VsNg">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_U-CYoOsYEeeP1-vgK6VsNg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+      <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+    </eAnnotations>
+    <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+  </profileApplication>
+</uml:Model>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.notation
new file mode 100644
index 0000000..ccd6103
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.notation
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_gqBjYGIWEeWaI82ZiBQcnA" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_hg79QGIWEeWaI82ZiBQcnA" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycGIWEeWaI82ZiBQcnA" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycWIWEeWaI82ZiBQcnA" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_hg9ycmIWEeWaI82ZiBQcnA" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg9yc2IWEeWaI82ZiBQcnA" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg9ydGIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg9ydWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg9ydmIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg9yd2IWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZgGIWEeWaI82ZiBQcnA" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZgWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-ZgmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-Zg2IWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZhGIWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZhWIWEeWaI82ZiBQcnA" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZhmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-Zh2IWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-ZiGIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZiWIWEeWaI82ZiBQcnA"/>
+    </children>
+    <element xmi:type="uml:Class" href="Package1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg79QWIWEeWaI82ZiBQcnA" x="100" y="100"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PyZEwPY9EeeID_yQhJd40g" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUPY9EeeID_yQhJd40g" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUfY9EeeID_yQhJd40g" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_PyekUvY9EeeID_yQhJd40g" y="15"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLYPY9EeeID_yQhJd40g" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLYfY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLYvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLY_Y9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLZPY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLZfY9EeeID_yQhJd40g" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLZvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLZ_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLaPY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLafY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLavY9EeeID_yQhJd40g" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLa_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLbPY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLbfY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLbvY9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyZEwfY9EeeID_yQhJd40g" x="100" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PynHMPY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PynHMfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PynHM_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PynHMvY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzEaMPY9EeeID_yQhJd40g" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PzFBQPY9EeeID_yQhJd40g" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PzFBQfY9EeeID_yQhJd40g" type="Package_PackagedElementCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PzFBQvY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzFBQ_Y9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzEaMfY9EeeID_yQhJd40g" x="240" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzKg0PY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PzKg0fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg0_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzKg0vY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_gqBjYWIWEeWaI82ZiBQcnA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_gqBjYmIWEeWaI82ZiBQcnA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PGOiUPY9EeeID_yQhJd40g" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_PynuQPY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PyZEwPY9EeeID_yQhJd40g" target="_PynHMPY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PynuQfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PyoVUvY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PynuQvY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUPY9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUfY9EeeID_yQhJd40g"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_PzKg1PY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PzEaMPY9EeeID_yQhJd40g" target="_PzKg0PY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PzKg1fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg2fY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PzKg1vY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg1_Y9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg2PY9EeeID_yQhJd40g"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.uml
new file mode 100644
index 0000000..c79211b
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/Package1.uml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:standard="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+  <uml:Package xmi:id="_3BK90GIREeWuYNIEaw6oIA" name="Package1">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3s5ZEOqDEeeGNpM5WA6vzA" source="http://www.eclipse.org/papyrus/2016/resource/shard">
+      <references xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+    </eAnnotations>
+    <packagedElement xmi:type="uml:Class" xmi:id="_Tvs-0GISEeWuYNIEaw6oIA" name="Class1"/>
+    <packagedElement xmi:type="uml:Class" xmi:id="_WhDDgOsYEeeP1-vgK6VsNg" name="Strings"/>
+    <packagedElement xmi:type="uml:Package" xmi:id="_cr1x0OsYEeeP1-vgK6VsNg" name="jface"/>
+  </uml:Package>
+  <standard:Utility xmi:id="_YxA7AOsYEeeP1-vgK6VsNg" base_Class="_WhDDgOsYEeeP1-vgK6VsNg"/>
+  <standard:Framework xmi:id="_g1o4wOsYEeeP1-vgK6VsNg" base_Package="_cr1x0OsYEeeP1-vgK6VsNg"/>
+</xmi:XMI>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.notation
new file mode 100644
index 0000000..3736abd
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.notation
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0p_EAGIREeWuYNIEaw6oIA" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_3BSSkGIREeWuYNIEaw6oIA" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_3BUHwGIREeWuYNIEaw6oIA" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_3BUHwWIREeWuYNIEaw6oIA" type="Package_PackagedElementCompartment">
+      <children xmi:type="notation:Shape" xmi:id="_Tv06oGISEeWuYNIEaw6oIA" type="Class_Shape_CN">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06omISEeWuYNIEaw6oIA" type="Class_NameLabel_CN"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06o2ISEeWuYNIEaw6oIA" type="Class_FloatingNameLabel_CN">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_Tv06pGISEeWuYNIEaw6oIA" y="5"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1hsGISEeWuYNIEaw6oIA" type="Class_AttributeCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hsWISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hsmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hs2ISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1htGISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1htWISEeWuYNIEaw6oIA" type="Class_OperationCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1htmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1ht2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1huGISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1huWISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1humISEeWuYNIEaw6oIA" type="Class_NestedClassifierCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hu2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hvGISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hvWISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1hvmISEeWuYNIEaw6oIA"/>
+        </children>
+        <element xmi:type="uml:Class" href="Package1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv06oWISEeWuYNIEaw6oIA" x="9" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_WhIjEOsYEeeP1-vgK6VsNg" type="Class_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYOsYEeeP1-vgK6VsNg" type="Class_NameLabel"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYesYEeeP1-vgK6VsNg" type="Class_FloatingNameLabel">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_WhLmYusYEeeP1-vgK6VsNg" y="15"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNcOsYEeeP1-vgK6VsNg" type="Class_AttributeCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNcesYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNcusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNc-sYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNdOsYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNdesYEeeP1-vgK6VsNg" type="Class_OperationCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNdusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNd-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNeOsYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNeesYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNeusYEeeP1-vgK6VsNg" type="Class_NestedClassifierCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNe-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNfOsYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNfesYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNfusYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhIjEesYEeeP1-vgK6VsNg" x="129" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_cs7-AOsYEeeP1-vgK6VsNg" type="Package_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_cs8lEOsYEeeP1-vgK6VsNg" type="Package_NameLabel"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_cs8lEesYEeeP1-vgK6VsNg" type="Package_PackagedElementCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_cs8lEusYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs8lE-sYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs7-AesYEeeP1-vgK6VsNg" x="249" y="8"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_3BUHwmIREeWuYNIEaw6oIA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BUHw2IREeWuYNIEaw6oIA"/>
+    </children>
+    <element xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BSSkWIREeWuYNIEaw6oIA" x="85" y="84" width="476" height="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_Yxn_AOsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_Yxn_AesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxomEOsYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Yxn_AusYEeeP1-vgK6VsNg" x="342" y="359"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_g19o5OsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_g19o5esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g19o5-sYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_g19o5usYEeeP1-vgK6VsNg" x="489" y="349"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_0p_EAWIREeWuYNIEaw6oIA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_0p_EAmIREeWuYNIEaw6oIA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PmS34OsYEeeP1-vgK6VsNg" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_Yxs3gOsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_WhIjEOsYEeeP1-vgK6VsNg" target="_Yxn_AOsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_Yxs3gesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxuFousYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Package1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Yxs3gusYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoOsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoesYEeeP1-vgK6VsNg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_g19o6OsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_cs7-AOsYEeeP1-vgK6VsNg" target="_g19o5OsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_g19o6esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g1-P8usYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Package1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_g19o6usYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8OsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8esYEeeP1-vgK6VsNg"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.uml
new file mode 100644
index 0000000..c38741a
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/origin/model.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0lgMoGIREeWuYNIEaw6oIA" name="RootElement">
+  <packagedElement xmi:type="uml:Package" href="Package1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_U-AjcOsYEeeP1-vgK6VsNg">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_U-CYoOsYEeeP1-vgK6VsNg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+      <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+    </eAnnotations>
+    <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+  </profileApplication>
+</uml:Model>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.notation
new file mode 100644
index 0000000..c267bf8
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.notation
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_gqBjYGIWEeWaI82ZiBQcnA" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_hg79QGIWEeWaI82ZiBQcnA" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycGIWEeWaI82ZiBQcnA" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_hg9ycWIWEeWaI82ZiBQcnA" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_hg9ycmIWEeWaI82ZiBQcnA" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg9yc2IWEeWaI82ZiBQcnA" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg9ydGIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg9ydWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg9ydmIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg9yd2IWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZgGIWEeWaI82ZiBQcnA" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZgWIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-ZgmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-Zg2IWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZhGIWEeWaI82ZiBQcnA"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_hg-ZhWIWEeWaI82ZiBQcnA" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_hg-ZhmIWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_hg-Zh2IWEeWaI82ZiBQcnA"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_hg-ZiGIWEeWaI82ZiBQcnA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg-ZiWIWEeWaI82ZiBQcnA"/>
+    </children>
+    <element xmi:type="uml:Class" href="Subunit1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hg79QWIWEeWaI82ZiBQcnA" x="100" y="100"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PyZEwPY9EeeID_yQhJd40g" type="Class_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUPY9EeeID_yQhJd40g" type="Class_NameLabel"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_PyekUfY9EeeID_yQhJd40g" type="Class_FloatingNameLabel">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_PyekUvY9EeeID_yQhJd40g" y="15"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLYPY9EeeID_yQhJd40g" type="Class_AttributeCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLYfY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLYvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLY_Y9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLZPY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLZfY9EeeID_yQhJd40g" type="Class_OperationCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLZvY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLZ_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLaPY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLafY9EeeID_yQhJd40g"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PyfLavY9EeeID_yQhJd40g" type="Class_NestedClassifierCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PyfLa_Y9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_PyfLbPY9EeeID_yQhJd40g"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_PyfLbfY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyfLbvY9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PyZEwfY9EeeID_yQhJd40g" x="100" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PynHMPY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PynHMfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PynHM_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PynHMvY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzEaMPY9EeeID_yQhJd40g" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_PzFBQPY9EeeID_yQhJd40g" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_PzFBQfY9EeeID_yQhJd40g" type="Package_PackagedElementCompartment">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_PzFBQvY9EeeID_yQhJd40g"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzFBQ_Y9EeeID_yQhJd40g"/>
+    </children>
+    <element xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzEaMfY9EeeID_yQhJd40g" x="240" y="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_PzKg0PY9EeeID_yQhJd40g" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_PzKg0fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg0_Y9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PzKg0vY9EeeID_yQhJd40g" x="200"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_gqBjYWIWEeWaI82ZiBQcnA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_gqBjYmIWEeWaI82ZiBQcnA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PGOiUPY9EeeID_yQhJd40g" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_PynuQPY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PyZEwPY9EeeID_yQhJd40g" target="_PynHMPY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PynuQfY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PyoVUvY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PynuQvY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUPY9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PyoVUfY9EeeID_yQhJd40g"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_PzKg1PY9EeeID_yQhJd40g" type="StereotypeCommentLink" source="_PzEaMPY9EeeID_yQhJd40g" target="_PzKg0PY9EeeID_yQhJd40g">
+    <styles xmi:type="notation:FontStyle" xmi:id="_PzKg1fY9EeeID_yQhJd40g"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_PzKg2fY9EeeID_yQhJd40g" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PzKg1vY9EeeID_yQhJd40g" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg1_Y9EeeID_yQhJd40g"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PzKg2PY9EeeID_yQhJd40g"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.uml
new file mode 100644
index 0000000..937fa29
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/Subunit1.uml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:standard="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+  <uml:Package xmi:id="_3BK90GIREeWuYNIEaw6oIA" name="Subunit1">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3s5ZEOqDEeeGNpM5WA6vzA" source="http://www.eclipse.org/papyrus/2016/resource/shard">
+      <references xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+    </eAnnotations>
+    <packagedElement xmi:type="uml:Class" xmi:id="_Tvs-0GISEeWuYNIEaw6oIA" name="Class1"/>
+    <packagedElement xmi:type="uml:Class" xmi:id="_WhDDgOsYEeeP1-vgK6VsNg" name="Strings"/>
+    <packagedElement xmi:type="uml:Package" xmi:id="_cr1x0OsYEeeP1-vgK6VsNg" name="jface"/>
+  </uml:Package>
+  <standard:Utility xmi:id="_YxA7AOsYEeeP1-vgK6VsNg" base_Class="_WhDDgOsYEeeP1-vgK6VsNg"/>
+  <standard:Framework xmi:id="_g1o4wOsYEeeP1-vgK6VsNg" base_Package="_cr1x0OsYEeeP1-vgK6VsNg"/>
+</xmi:XMI>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.di b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.notation b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.notation
new file mode 100644
index 0000000..961fdc5
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.notation
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0p_EAGIREeWuYNIEaw6oIA" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_3BSSkGIREeWuYNIEaw6oIA" type="Package_Shape">
+    <children xmi:type="notation:DecorationNode" xmi:id="_3BUHwGIREeWuYNIEaw6oIA" type="Package_NameLabel"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_3BUHwWIREeWuYNIEaw6oIA" type="Package_PackagedElementCompartment">
+      <children xmi:type="notation:Shape" xmi:id="_Tv06oGISEeWuYNIEaw6oIA" type="Class_Shape_CN">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06omISEeWuYNIEaw6oIA" type="Class_NameLabel_CN"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Tv06o2ISEeWuYNIEaw6oIA" type="Class_FloatingNameLabel_CN">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_Tv06pGISEeWuYNIEaw6oIA" y="5"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1hsGISEeWuYNIEaw6oIA" type="Class_AttributeCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hsWISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hsmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hs2ISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1htGISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1htWISEeWuYNIEaw6oIA" type="Class_OperationCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1htmISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1ht2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1huGISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1huWISEeWuYNIEaw6oIA"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_Tv1humISEeWuYNIEaw6oIA" type="Class_NestedClassifierCompartment_CN">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_Tv1hu2ISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_Tv1hvGISEeWuYNIEaw6oIA"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_Tv1hvWISEeWuYNIEaw6oIA"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv1hvmISEeWuYNIEaw6oIA"/>
+        </children>
+        <element xmi:type="uml:Class" href="Subunit1.uml#_Tvs-0GISEeWuYNIEaw6oIA"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Tv06oWISEeWuYNIEaw6oIA" x="9" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_WhIjEOsYEeeP1-vgK6VsNg" type="Class_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYOsYEeeP1-vgK6VsNg" type="Class_NameLabel"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_WhLmYesYEeeP1-vgK6VsNg" type="Class_FloatingNameLabel">
+          <layoutConstraint xmi:type="notation:Location" xmi:id="_WhLmYusYEeeP1-vgK6VsNg" y="15"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNcOsYEeeP1-vgK6VsNg" type="Class_AttributeCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNcesYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNcusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNc-sYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNdOsYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNdesYEeeP1-vgK6VsNg" type="Class_OperationCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNdusYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNd-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNeOsYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNeesYEeeP1-vgK6VsNg"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_WhMNeusYEeeP1-vgK6VsNg" type="Class_NestedClassifierCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_WhMNe-sYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_WhMNfOsYEeeP1-vgK6VsNg"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_WhMNfesYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhMNfusYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WhIjEesYEeeP1-vgK6VsNg" x="129" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_cs7-AOsYEeeP1-vgK6VsNg" type="Package_Shape">
+        <children xmi:type="notation:DecorationNode" xmi:id="_cs8lEOsYEeeP1-vgK6VsNg" type="Package_NameLabel"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_cs8lEesYEeeP1-vgK6VsNg" type="Package_PackagedElementCompartment">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_cs8lEusYEeeP1-vgK6VsNg"/>
+          <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs8lE-sYEeeP1-vgK6VsNg"/>
+        </children>
+        <element xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cs7-AesYEeeP1-vgK6VsNg" x="249" y="8"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_3BUHwmIREeWuYNIEaw6oIA"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BUHw2IREeWuYNIEaw6oIA"/>
+    </children>
+    <element xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3BSSkWIREeWuYNIEaw6oIA" x="85" y="84" width="476" height="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_Yxn_AOsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_Yxn_AesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxomEOsYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Yxn_AusYEeeP1-vgK6VsNg" x="342" y="359"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_g19o5OsYEeeP1-vgK6VsNg" type="StereotypeComment">
+    <styles xmi:type="notation:TitleStyle" xmi:id="_g19o5esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g19o5-sYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_g19o5usYEeeP1-vgK6VsNg" x="489" y="349"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_0p_EAWIREeWuYNIEaw6oIA" name="diagram_compatibility_version" stringValue="1.3.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_0p_EAmIREeWuYNIEaw6oIA"/>
+  <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_PmS34OsYEeeP1-vgK6VsNg" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+    <owner xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_0lgMoGIREeWuYNIEaw6oIA"/>
+  <edges xmi:type="notation:Connector" xmi:id="_Yxs3gOsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_WhIjEOsYEeeP1-vgK6VsNg" target="_Yxn_AOsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_Yxs3gesYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_YxuFousYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Class" href="Subunit1.uml#_WhDDgOsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Yxs3gusYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoOsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YxuFoesYEeeP1-vgK6VsNg"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_g19o6OsYEeeP1-vgK6VsNg" type="StereotypeCommentLink" source="_cs7-AOsYEeeP1-vgK6VsNg" target="_g19o5OsYEeeP1-vgK6VsNg">
+    <styles xmi:type="notation:FontStyle" xmi:id="_g19o6esYEeeP1-vgK6VsNg"/>
+    <styles xmi:type="notation:EObjectValueStyle" xmi:id="_g1-P8usYEeeP1-vgK6VsNg" name="BASE_ELEMENT">
+      <eObjectValue xmi:type="uml:Package" href="Subunit1.uml#_cr1x0OsYEeeP1-vgK6VsNg"/>
+    </styles>
+    <element xsi:nil="true"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_g19o6usYEeeP1-vgK6VsNg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8OsYEeeP1-vgK6VsNg"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_g1-P8esYEeeP1-vgK6VsNg"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.uml b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.uml
new file mode 100644
index 0000000..ec03fd2
--- /dev/null
+++ b/plugins/compare/tests/org.eclipse.papyrus.compare.diagram.tests.git/testmodels/resourceattachmentchange/rename5/right/model.uml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_0lgMoGIREeWuYNIEaw6oIA" name="RootElement">
+  <packagedElement xmi:type="uml:Package" href="Subunit1.uml#_3BK90GIREeWuYNIEaw6oIA"/>
+  <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_U-AjcOsYEeeP1-vgK6VsNg">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_U-CYoOsYEeeP1-vgK6VsNg" source="http://www.eclipse.org/uml2/2.0.0/UML">
+      <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+    </eAnnotations>
+    <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+  </profileApplication>
+</uml:Model>