Removed unnecessary casts from Bug 430981: Add type information to IServiceLocator...
authorMarkus Keller <markus_keller@ch.ibm.com>
Tue, 12 Aug 2014 12:55:43 +0000 (14:55 +0200)
committerMarkus Keller <markus_keller@ch.ibm.com>
Tue, 12 Aug 2014 12:55:43 +0000 (14:55 +0200)
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java
org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java

index 541a80d..458546c 100644 (file)
@@ -1453,7 +1453,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
         */
        public static IEvaluationContext createEvaluationContext(Object defaultvar) {
                IEvaluationContext parent = null;
-               IEvaluationService esrvc = (IEvaluationService)PlatformUI.getWorkbench().getService(IEvaluationService.class);
+               IEvaluationService esrvc = PlatformUI.getWorkbench().getService(IEvaluationService.class);
                if (esrvc != null) {
                        parent = esrvc.getCurrentState();
                }
index b823527..5f3db1f 100644 (file)
@@ -95,13 +95,13 @@ public class DetailPaneAssignValueAction extends Action{
                fViewSite = viewSite;
                
                setEnabled(false);
-        IHandlerService service = (IHandlerService) fViewSite.getService(IHandlerService.class);
+        IHandlerService service = fViewSite.getService(IHandlerService.class);
         ActionHandler handler = new ActionHandler(this);
         fHandlerActivation = service.activateHandler(getActionDefinitionId(), handler);
        }
                
        public void dispose() {
-        IHandlerService service = (IHandlerService) fViewSite.getService(IHandlerService.class);
+        IHandlerService service = fViewSite.getService(IHandlerService.class);
         service.deactivateHandler(fHandlerActivation);
     }
 
index 06b4f2d..68c35f2 100644 (file)
@@ -155,7 +155,7 @@ public class DebugContextManager implements IDebugContextManager {
        protected IDebugContextService createService(IWorkbenchWindow window) {
                DebugWindowContextService service = fServices.get(window);
                if (service == null) {
-                       IEvaluationService evaluationService = (IEvaluationService)window.getService(IEvaluationService.class);
+                       IEvaluationService evaluationService = window.getService(IEvaluationService.class);
                        if (window.getShell() == null || evaluationService == null) {
                                // the window has been closed - return a dummy service
                                return NULL_SERVICE;
index 4462e29..3127664 100644 (file)
@@ -247,8 +247,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
         // add EOF submissions
         IPageSite site = fPage.getSite();
         if(fActivatedContext == null && fActivatedHandler == null) {
-               IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
-               IContextService contextService = (IContextService)site.getService(IContextService.class);
+               IHandlerService handlerService = site.getService(IHandlerService.class);
+               IContextService contextService = site.getService(IContextService.class);
                fActivatedContext = contextService.activateContext(fContextId);
                fActivatedHandler = handlerService.activateHandler("org.eclipse.debug.ui.commands.eof", fEOFHandler); //$NON-NLS-1$
         }
@@ -261,8 +261,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
        public void deactivated() {
         // remove EOF submissions
         IPageSite site = fPage.getSite();
-        IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
-        IContextService contextService = (IContextService)site.getService(IContextService.class);
+        IHandlerService handlerService = site.getService(IHandlerService.class);
+        IContextService contextService = site.getService(IContextService.class);
         handlerService.deactivateHandler(fActivatedHandler);
                contextService.deactivateContext(fActivatedContext);
                fActivatedContext = null;
index 34b7d1f..570fe9e 100644 (file)
@@ -945,7 +945,7 @@ public class LaunchView extends AbstractDebugView
                super.init(site);
                commonInit(site);
                preferenceInit(site);
-               fContextService = (IContextService)site.getService(IContextService.class);
+               fContextService = site.getService(IContextService.class);
        }
 
        /* (non-Javadoc)
@@ -956,7 +956,7 @@ public class LaunchView extends AbstractDebugView
                super.init(site, memento);
                commonInit(site);
         preferenceInit(site);
-        fContextService = (IContextService)site.getService(IContextService.class);
+        fContextService = site.getService(IContextService.class);
        }
 
     /* (non-Javadoc)
index 6fbf134..f45b795 100644 (file)
@@ -370,9 +370,9 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
        }
 
        public void activateHandlers() {
-               ICommandService commandSupport = (ICommandService) getSite().getService(ICommandService.class);
-               IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
-               IContextService contextSupport = (IContextService) getSite().getService(IContextService.class);
+               ICommandService commandSupport = getSite().getService(ICommandService.class);
+               IHandlerService handlerService = getSite().getService(IHandlerService.class);
+               IContextService contextSupport = getSite().getService(IContextService.class);
 
                if (commandSupport != null && handlerService != null && contextSupport != null) {
                        contextSupport.activateContext(ID_MEMORY_VIEW_CONTEXT);
index 90d76f8..4e295be 100644 (file)
@@ -972,7 +972,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
                
                action = new CollapseAllAction((TreeModelViewer)getViewer());
                setAction(COLLAPSE_ALL, action); 
-               IHandlerService hs = (IHandlerService) getSite().getService(IHandlerService.class);
+               IHandlerService hs = getSite().getService(IHandlerService.class);
                if (hs != null) {
                        hs.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(action));
                }
index be0aa76..51e753b 100644 (file)
@@ -514,7 +514,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
                textAction.setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_DLCL_CONTENT_ASSIST));
                PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_CONTENT_ASSIST_ACTION);
                ActionHandler actionHandler = new ActionHandler(textAction);
-        IHandlerService handlerService = (IHandlerService) getViewSite().getService(IHandlerService.class);
+        IHandlerService handlerService = getViewSite().getService(IHandlerService.class);
         fContentAssistActivation = handlerService.activateHandler(textAction.getActionDefinitionId(), actionHandler);
         setAction(DETAIL_CONTENT_ASSIST_ACTION, textAction);
                        
@@ -695,7 +695,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
                                ((DetailPaneAssignValueAction)action).dispose();
                        }
                        if (fContentAssistActivation != null){
-                               IHandlerService service = (IHandlerService) getViewSite().getService(IHandlerService.class);
+                               IHandlerService service = getViewSite().getService(IHandlerService.class);
                        service.deactivateHandler(fContentAssistActivation);
                        fContentAssistActivation = null;
                        }
index b11185a..aff60b5 100644 (file)
@@ -114,11 +114,11 @@ public class BreakpointTypesContribution extends CompoundContributionItem implem
         ISelection selection = null;
         
         ISelectionService selectionService = 
-            (ISelectionService)fServiceLocator.getService(ISelectionService.class);
+            fServiceLocator.getService(ISelectionService.class);
         if (selectionService != null) {
             selection = selectionService.getSelection();
         }
-        IPartService partService = (IPartService)fServiceLocator.getService(IPartService.class);
+        IPartService partService = fServiceLocator.getService(IPartService.class);
         if (partService != null) {
             part = partService.getActivePart();
         }
index b58ccae..26fe989 100644 (file)
@@ -161,7 +161,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
                        fAction.setText(getText());\r
                        fAction.setToolTipText(getTooltipText());\r
                        String commandId = getCommandId();\r
-                       ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);\r
+                       ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class);\r
                        if (service != null) {\r
                                Command command = service.getCommand(commandId);\r
                                command.undefine();\r
index 76bb889..adf1d42 100644 (file)
@@ -649,7 +649,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
        public void partActivated(IWorkbenchPartReference partRef) {
                if (isThisPart(partRef)) {
                        fActive = true;
-                       IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+                       IContextService contextService = getSite().getService(IContextService.class);
                        if(contextService != null) {
                                fActivatedContext = contextService.activateContext(IConsoleConstants.ID_CONSOLE_VIEW);
                                activateParticipants(fActiveConsole);
@@ -669,7 +669,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
        public void partDeactivated(IWorkbenchPartReference partRef) {
         if (isThisPart(partRef)) {
                        fActive = false;
-                       IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+                       IContextService contextService = getSite().getService(IContextService.class);
                        if(contextService != null) {
                                contextService.deactivateContext(fActivatedContext);
                                deactivateParticipants(fActiveConsole);