Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2019-05-20 03:45:22 -0400
committerNicolas FAUVERGUE2019-05-20 04:54:25 -0400
commit5fa5dbaf710fc2fb3510a405fca12e2c239c60d8 (patch)
tree65f538c34be7916bc1b76bada019bf15eff0ed9a
parent940e7bd48a4c9d9fbf0895cba04b7bdf6ca94d1d (diff)
downloadorg.eclipse.papyrus-5fa5dbaf710fc2fb3510a405fca12e2c239c60d8.tar.gz
org.eclipse.papyrus-5fa5dbaf710fc2fb3510a405fca12e2c239c60d8.tar.xz
org.eclipse.papyrus-5fa5dbaf710fc2fb3510a405fca12e2c239c60d8.zip
Bug 547099: ClassCastException in ToggleSubmodelHandler
Avoid possible exceptions Change-Id: Icdedb72739607230238fc63e21bca40beb51951a Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/handler/ToggleSubmodelHandler.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/handler/ToggleSubmodelHandler.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/handler/ToggleSubmodelHandler.java
index c85abb33e4a..64e00702a82 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/handler/ToggleSubmodelHandler.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/handler/ToggleSubmodelHandler.java
@@ -27,7 +27,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.util.TransactionUtil;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.infra.emf.resource.ShardResourceHelper;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
@@ -81,7 +80,7 @@ public class ToggleSubmodelHandler extends AbstractHandler {
EObject result = null;
Object value = HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
- if (value instanceof ISelection) {
+ if (value instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection) value;
result = ((List<?>) selection.toList()).stream()
.map(EMFHelper::getEObject)

Back to the top