Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-05-10 19:07:49 +0000
committerGerrit Code Review @ Eclipse.org2016-05-11 11:34:50 +0000
commit997dd877570219277084ca366bc14e2d69eb03a6 (patch)
treeaebde9dc29d4d7750dcf9e019fa0aec467365943 /plugins
parentbb5f25e3f931dcf9fb7baec4a87b4413712c71aa (diff)
downloadorg.eclipse.papyrus-997dd877570219277084ca366bc14e2d69eb03a6.tar.gz
org.eclipse.papyrus-997dd877570219277084ca366bc14e2d69eb03a6.tar.xz
org.eclipse.papyrus-997dd877570219277084ca366bc14e2d69eb03a6.zip
Bug 493375: [Viewpoints] Cannot create two state-machine diagrams in succession
https://bugs.eclipse.org/bugs/show_bug.cgi?id=493375 Use object identity instead of structural equality in determining whether an object is the owner or context of a view. Includes a new JUnit test plug-in with test cases for the affected methods that fail without the fix. Change-Id: Idf1039b1911088e538ab66b17f67b6ee82b955ac
Diffstat (limited to 'plugins')
-rw-r--r--[-rwxr-xr-x]plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java
index e0b95afe2e4..906281ee252 100755..100644
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java
@@ -8,7 +8,7 @@
*
* Contributors:
* Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- * Christian W. Damus - bug 474467
+ * Christian W. Damus - bugs 474467, 493375
*
*****************************************************************************/
package org.eclipse.papyrus.infra.viewpoints.policy;
@@ -31,7 +31,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.viewpoints.configuration.Category;
import org.eclipse.papyrus.infra.viewpoints.configuration.ModelRule;
@@ -462,7 +461,7 @@ public abstract class ViewPrototype {
ViewPrototype proto = ViewPrototype.get(view);
if (this == proto) {
EObject owner = proto.getOwnerOf(view);
- if (EcoreUtil.equals(owner, element)) {
+ if (owner == element) {
count++;
}
}
@@ -490,7 +489,7 @@ public abstract class ViewPrototype {
ViewPrototype proto = ViewPrototype.get(view);
if (this == proto) {
EObject root = proto.getRootOf(view);
- if (EcoreUtil.equals(root, element)) {
+ if (root == element) {
count++;
}
}

Back to the top