Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java9
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java6
2 files changed, 9 insertions, 6 deletions
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java
index 31eb8656a0d..77608a3586c 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 Atos
*
- *
+ *
* 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
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.
/***
* An IMatchingItem implementation that matches for LinkItems
- *
+ *
* @author proland
*/
public class LinkItemMatchingItem implements IMatchingItem {
@@ -37,7 +37,10 @@ public class LinkItemMatchingItem implements IMatchingItem {
public boolean matchingItemEquals(Object obj) {
if(obj instanceof EReferenceTreeElement) {
if(ref != null && parent != null) {
- return parent.equals(((EReferenceTreeElement)obj).getParent()) && ref.equals(((EReferenceTreeElement)obj).getEReference());
+ EReferenceTreeElement other = (EReferenceTreeElement)obj;
+ EObject semanticParent = other.getParent().getEObject();
+ EReference otherReference = other.getEReference();
+ return parent == semanticParent && ref == otherReference;
}
}
return super.equals(obj);
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java
index b4b75e381a9..ad12db3a7e1 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 Atos
*
- *
+ *
* 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
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.
/***
* An IMatchingItem implementation that matches for ModelElementItem
- *
+ *
* @author proland
*/
public class ModelElementItemMatchingItem implements IMatchingItem {
@@ -32,7 +32,7 @@ public class ModelElementItemMatchingItem implements IMatchingItem {
public boolean matchingItemEquals(Object obj) {
if(element != null && obj instanceof EObjectTreeElement) {
- return element.equals(((EObjectTreeElement)obj).getEObject());
+ return element == ((EObjectTreeElement)obj).getEObject();
}
return super.equals(obj);
}

Back to the top