tmf: Fix TmfProjectModelElement.equals()
authorPatrick Tasse <patrick.tasse@gmail.com>
Thu, 28 Apr 2016 17:47:27 +0000 (13:47 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Thu, 28 Apr 2016 21:54:06 +0000 (17:54 -0400)
Elements of different types but with equal path should not be considered
equal. This avoids clashes between trace names and 'virtual' resource
name used by some elements, such as module id for an analysis element.

Change-Id: Id2238a9e8fe4ba9b8daede86b3a2b54d0de3b815
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/71628
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfProjectModelElement.java

index 62a42ccae30285adce49c0398c3be0b9aa4283fc..b87817159eb942cc01c2db00e9e611d9ceeb6863 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2016 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -186,7 +186,7 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement
         if (other == null) {
             return false;
         }
-        if (!(other instanceof TmfProjectModelElement)) {
+        if (!(other.getClass().equals(this.getClass()))) {
             return false;
         }
         TmfProjectModelElement element = (TmfProjectModelElement) other;
This page took 0.024928 seconds and 5 git commands to generate.