commit | 5763f43d990ef15935174ffc2aeaa3735dc68ef1 | [log] [tgz] |
---|---|---|
author | Ansgar Radermacher <ansgar.radermacher@cea.fr> | Fri Feb 15 14:24:47 2019 +0100 |
committer | Ansgar Radermacher <ansgar.radermacher@cea.fr> | Fri Feb 15 14:24:47 2019 +0100 |
tree | f676b7aa73945ba748076779d4d01a012a7980da | |
parent | 97e32ea1051859f01a1b68981fd996e22384e7a8 [diff] |
Prevent possibility of class-cast exception in handler Signed-off-by: Ansgar Radermacher <ansgar.radermacher@cea.fr>
diff --git a/core/profile/org.polarsys.esf.core.profile.esfarchitectureconcepts.application/src/main/java/org/polarsys/esf/core/profile/esfarchitectureconcepts/application/handler/ApplyESFArchitectureConceptsAnnotationHandler.java b/core/profile/org.polarsys.esf.core.profile.esfarchitectureconcepts.application/src/main/java/org/polarsys/esf/core/profile/esfarchitectureconcepts/application/handler/ApplyESFArchitectureConceptsAnnotationHandler.java index da45121..4b281df 100644 --- a/core/profile/org.polarsys.esf.core.profile.esfarchitectureconcepts.application/src/main/java/org/polarsys/esf/core/profile/esfarchitectureconcepts/application/handler/ApplyESFArchitectureConceptsAnnotationHandler.java +++ b/core/profile/org.polarsys.esf.core.profile.esfarchitectureconcepts.application/src/main/java/org/polarsys/esf/core/profile/esfarchitectureconcepts/application/handler/ApplyESFArchitectureConceptsAnnotationHandler.java
@@ -17,6 +17,7 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.Model; import org.eclipse.uml2.uml.UMLPackage; import org.polarsys.esf.core.profile.esfarchitectureconcepts.application.ApplyESFArchitectureConceptsAnnotation; @@ -46,8 +47,8 @@ public Object execute(final ExecutionEvent pEvent) throws ExecutionException { ISelection vSelection = HandlerUtil.getCurrentSelection(pEvent); - final Model vSelectedElement = - (Model) ModelUtil.getSelectedEObjectOfType(vSelection, UMLPackage.eINSTANCE.getElement()); + final Element vSelectedElement = (Element) + ModelUtil.getSelectedEObjectOfType(vSelection, UMLPackage.eINSTANCE.getElement()); final Model vSelectedModel = vSelectedElement.getModel();