summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-03-25 03:59:44 (EDT)
committerLaurent Wouters2014-03-25 10:16:45 (EDT)
commit1ccfec07a10987a0a2f0b90bc20d69a0fe7c5aaf (patch)
tree7a6f34699e6730d46aa7169c63cdb374031faa3d
parentbd06e7715877e2dee9c8bbe0a7c7af6a927a3985 (diff)
downloadorg.eclipse.papyrus-1ccfec07a10987a0a2f0b90bc20d69a0fe7c5aaf.zip
org.eclipse.papyrus-1ccfec07a10987a0a2f0b90bc20d69a0fe7c5aaf.tar.gz
org.eclipse.papyrus-1ccfec07a10987a0a2f0b90bc20d69a0fe7c5aaf.tar.bz2
#430703: [Model Explorer] NPE throw when an invalid diagram is added to the model
Reduced the possible view creation on an element to views that can both be owned and have the element as root https://bugs.eclipse.org/bugs/show_bug.cgi?id=430703 Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PolicyChecker.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PolicyChecker.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PolicyChecker.java
index 81156d1..18fbec7 100755
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PolicyChecker.java
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/PolicyChecker.java
@@ -628,6 +628,9 @@ public class PolicyChecker {
int count = getOwnedViewCount(element, proto);
if (!matchesOwnerMultiplicity(view, element.eClass(), stereotypes, count))
continue;
+ count = getViewCountOn(element, proto);
+ if (!matchesRootMultiplicity(view, element.eClass(), stereotypes, count))
+ continue;
result.add(proto);
}
}