diff options
author | Nicolas FAUVERGUE | 2019-05-20 07:45:22 +0000 |
---|---|---|
committer | Nicolas FAUVERGUE | 2019-05-20 08:54:25 +0000 |
commit | 5fa5dbaf710fc2fb3510a405fca12e2c239c60d8 (patch) | |
tree | 65f538c34be7916bc1b76bada019bf15eff0ed9a /plugins | |
parent | 940e7bd48a4c9d9fbf0895cba04b7bdf6ca94d1d (diff) | |
download | org.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>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/handler/ToggleSubmodelHandler.java | 3 |
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) |