Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuai Li2015-08-17 15:55:23 +0000
committerGerrit Code Review @ Eclipse.org2015-09-11 14:42:10 +0000
commit787ccf0c585ca433eeb28394b64fb50f1e1dc7cd (patch)
tree0d1b382b1c7beffd9342657d95dd34b63e33cf11 /plugins/views
parent752cdd6415ff0ece5906a557bbdec910f4ac2395 (diff)
downloadorg.eclipse.papyrus-787ccf0c585ca433eeb28394b64fb50f1e1dc7cd.tar.gz
org.eclipse.papyrus-787ccf0c585ca433eeb28394b64fb50f1e1dc7cd.tar.xz
org.eclipse.papyrus-787ccf0c585ca433eeb28394b64fb50f1e1dc7cd.zip
Bug 475182 - [Search] Remplace EcoreUtil.equals with URI comparison to
increase performance - Replace EcoreUtil.equals with EcoreUtil.getURI(...).equals(...) Change-Id: I707d600312b181fae32e32942a80c098f1439c48 Signed-off-by: Shuai Li <shuai.li@cea.fr>
Diffstat (limited to 'plugins/views')
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java2
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java
index 31050fa5112..1db41bb7c31 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java
@@ -155,7 +155,7 @@ public abstract class AbstractResultEntry extends Match {
// support comparison against EObjects
// FIXME: This violates the symmetry contract of Object::equals!
if (obj instanceof EObject && this.getSource() instanceof EObject) {
- if (EcoreUtil.equals((EObject) this.getSource(), (EObject) obj)) {
+ if (EcoreUtil.getURI((EObject) this.getSource()).equals(EcoreUtil.getURI((EObject) obj))) {
if (((AbstractResultEntry) obj).getOffset() == this.getOffset()) {
if (((AbstractResultEntry) obj).getLength() == this.getLength()) {
return true;
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java
index 3331139faab..e3ed8e09156 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java
@@ -100,7 +100,7 @@ public class AttributeMatch extends ModelMatch {
if (obj instanceof AttributeMatch) {
if (super.equals(obj)) {
if (((AttributeMatch) obj).getSource() instanceof EObject && this.getSource() instanceof EObject) {
- if (EcoreUtil.equals((EObject) ((AttributeMatch) obj).getSource(), (EObject) this.getSource())) {
+ if (EcoreUtil.getURI((EObject) ((AttributeMatch) obj).getSource()).equals(EcoreUtil.getURI((EObject) this.getSource()))) {
if (obj.hashCode() == this.hashCode()) {
return true;
}

Back to the top