Fix cast warnings (errors) when targetting 4.5
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 22 Oct 2014 17:28:35 +0000 (13:28 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 22 Oct 2014 20:51:33 +0000 (16:51 -0400)
Change-Id: I39acc21f45f474e09366b3610bcff3d538c8e3ad
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/35355
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/handlers/OpenAction.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/SDWidget.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/handlers/KeyBindingsManager.java

index c6696141a0d248322f36fd6f881a2bcb24d6f6ba..eb2fe3ad3acab0cf93cac79472256d503640f417 100644 (file)
@@ -200,7 +200,8 @@ public class TraceControlTestFacility {
      * @throws NotHandledException
      */
     public void executeCommand(String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {
-        IHandlerService handlerService = (IHandlerService) fControlView.getSite().getService(IHandlerService.class);
+        Object handlerServiceObject = fControlView.getSite().getService(IHandlerService.class);
+        IHandlerService handlerService = (IHandlerService) handlerServiceObject;
         handlerService.executeCommand(COMMAND_CATEGORY_PREFIX + commandId, null);
         waitForJobs();
     }
index 8df2de5c67384f2328afd55a38daa931e1c72f17..6c242ae832ad456e4a5cb7a5fda74cf8c55cc2fe 100644 (file)
@@ -69,7 +69,8 @@ public class OpenAction extends Action {
     @Override
     public void run() {
         try {
-            IHandlerService handlerService = (IHandlerService) page.getActivePart().getSite().getService(IHandlerService.class);
+            Object service = page.getActivePart().getSite().getService(IHandlerService.class);
+            IHandlerService handlerService = (IHandlerService) service;
             boolean executeCommand = ((element instanceof TmfTraceElement) || (element instanceof TmfAnalysisOutputElement));
 
             if (!executeCommand && element instanceof TmfExperimentElement) {
index 2f7783f16bd0047b30a3de38d65a1cdd50a9e1c8..e074fa297c0b8af91b59d769a0ca025862948535 100644 (file)
@@ -831,8 +831,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             @Override
             public void run() {
                 IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-                IHandlerService handlerService = (IHandlerService) activePage.getActiveEditor().getSite().getService(IHandlerService.class);
-                ICommandService cmdService = (ICommandService) activePage.getActiveEditor().getSite().getService(ICommandService.class);
+                Object handlerServiceObject = activePage.getActiveEditor().getSite().getService(IHandlerService.class);
+                IHandlerService handlerService = (IHandlerService) handlerServiceObject;
+                Object cmdServiceObject = activePage.getActiveEditor().getSite().getService(ICommandService.class);
+                ICommandService cmdService = (ICommandService) cmdServiceObject;
                 try {
                     HashMap<String, Object> parameters = new HashMap<>();
                     Command command = cmdService.getCommand(ExportToTextCommandHandler.COMMAND_ID);
index 089ebc0e498b50f3610d9bc927e66534705164a4..c4ec17ea56a08639f71a26ed9e7676ae869a85fa 100755 (executable)
@@ -545,7 +545,8 @@ public class SDWidget extends ScrollView implements SelectionListener,
     public void setSite(ViewPart viewSite) {
         fSite = viewSite;
         fSite.getSite().setSelectionProvider(fSelProvider);
-        IContextService service = (IContextService) fSite.getSite().getWorkbenchWindow().getService(IContextService.class);
+        Object serviceObject = fSite.getSite().getWorkbenchWindow().getService(IContextService.class);
+        IContextService service = (IContextService) serviceObject;
         service.activateContext("org.eclipse.linuxtools.tmf.ui.view.uml2sd.context"); //$NON-NLS-1$
         service.activateContext(IContextIds.CONTEXT_ID_WINDOW);
     }
index c4e9c8d3ae53e96930eb16d6ead89faf50dc51ac..847146336f1ae520722715f1fb5d92bd925d3ef7 100644 (file)
@@ -147,7 +147,8 @@ public class KeyBindingsManager {
      */
     private void initialize() {
         fGoToMessageForKeyBinding = new MoveToMessage();
-        IHandlerService service = (IHandlerService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IHandlerService.class);
+        Object serviceObject = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IHandlerService.class);
+        IHandlerService service = (IHandlerService) serviceObject;
         AbstractHandler handler = new AbstractHandler() {
             @Override
             public Object execute(ExecutionEvent event) throws ExecutionException {
@@ -256,7 +257,8 @@ public class KeyBindingsManager {
             //During Eclipse shutdown the active workbench window is null
             return;
         }
-        IHandlerService service = (IHandlerService) window.getService(IHandlerService.class);
+        Object serviceObject = window.getService(IHandlerService.class);
+        IHandlerService service = (IHandlerService) serviceObject;
         for(IHandlerActivation activation : fHandlerActivations) {
             service.deactivateHandler(activation);
         }
This page took 0.028832 seconds and 5 git commands to generate.