diff options
author | Dani Megert | 2015-02-20 12:08:00 +0000 |
---|---|---|
committer | Dani Megert | 2015-02-20 12:08:00 +0000 |
commit | 035b16c4845dde58ab3f6463878cbe662349e58c (patch) | |
tree | a312725ef6ac6c4aeedc3ca81bad03b0583f5fb1 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch | |
parent | 87bf3db976790862ceb9b321661e0234afb342ca (diff) | |
download | eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.tar.gz eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.tar.xz eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.zip |
Fixed bug 460417: Fix compiler problems from generified IAdaptable#getAdapter(..)
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch')
3 files changed, 58 insertions, 54 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java index f75f7a5cb..997f2a89f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.views.launch; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; + import org.eclipse.ui.IPropertyListener; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchPartSite; @@ -122,7 +123,7 @@ class BreadcrumbWorkbenchPart implements IWorkbenchPart { * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @Override - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { return null; } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java index 6475b0969..d0158505c 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,6 +14,7 @@ package org.eclipse.debug.internal.ui.views.launch; import org.eclipse.core.runtime.IAdapterFactory; + import org.eclipse.debug.core.IExpressionManager; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchManager; @@ -85,6 +86,7 @@ import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapt import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory; import org.eclipse.debug.internal.ui.viewers.update.DefaultModelSelectionPolicyFactory; import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment; + import org.eclipse.debug.ui.sourcelookup.ISourceDisplay; /** @@ -146,98 +148,99 @@ public class DebugElementAdapterFactory implements IAdapterFactory { /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) */ - @Override - public Object getAdapter(Object adaptableObject, Class adapterType) { + @SuppressWarnings("unchecked") + @Override + public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adapterType.isInstance(adaptableObject)) { - return adaptableObject; + return (T) adaptableObject; } if (adapterType.equals(IAsynchronousContentAdapter.class)) { if (adaptableObject instanceof IMemoryBlockRetrieval) { - return fgAsyncMemoryRetrieval; + return (T) fgAsyncMemoryRetrieval; } if (adaptableObject instanceof IMemoryBlock) { - return fgAsyncMemoryBlock; + return (T) fgAsyncMemoryBlock; } } if (adapterType.equals(IElementContentProvider.class)) { if (adaptableObject instanceof ILaunchManager) { - return fgCPLaunchManger; + return (T) fgCPLaunchManger; } if (adaptableObject instanceof ILaunch) { - return fgCPLaunch; + return (T) fgCPLaunch; } if (adaptableObject instanceof IProcess) { - return fgCPProcess; + return (T) fgCPProcess; } if (adaptableObject instanceof IDebugTarget) { - return fgCPTarget; + return (T) fgCPTarget; } if (adaptableObject instanceof IMemoryBlockRetrieval) { - return fgCPMemoryRetrieval; + return (T) fgCPMemoryRetrieval; } if (adaptableObject instanceof IThread) { - return fgCPThread; + return (T) fgCPThread; } if (adaptableObject instanceof IStackFrame) { - return fgCPFrame; + return (T) fgCPFrame; } if (adaptableObject instanceof IVariable) { - return fgCPVariable; + return (T) fgCPVariable; } if (adaptableObject instanceof IExpressionManager) { - return fgCPExpressionManager; + return (T) fgCPExpressionManager; } if (adaptableObject instanceof IExpression) { - return fgCPExpression; + return (T) fgCPExpression; } if (adaptableObject instanceof IRegisterGroup) { - return fgCPRegisterGroup; + return (T) fgCPRegisterGroup; } if (adaptableObject instanceof IMemoryBlock) { - return fgCPMemoryBlock; + return (T) fgCPMemoryBlock; } if (adaptableObject instanceof DefaultBreakpointsViewInput) { - return fgCPBreakpointManager; + return (T) fgCPBreakpointManager; } if (adaptableObject instanceof IBreakpoint) { - return fgCPBreakpoint; + return (T) fgCPBreakpoint; } } if (adapterType.equals(IAsynchronousLabelAdapter.class)) { if (adaptableObject instanceof IMemoryBlock) { - return fgMemoryBlockLabelAdapter; + return (T) fgMemoryBlockLabelAdapter; } if (adaptableObject instanceof MemorySegment) { - return fgTableRenderingLineLabelAdapter; + return (T) fgTableRenderingLineLabelAdapter; } - return fgDebugLabelAdapter; + return (T) fgDebugLabelAdapter; } if (adapterType.equals(IElementLabelProvider.class)) { if (adaptableObject instanceof IVariable) { - return fgLPVariable; + return (T) fgLPVariable; } if (adaptableObject instanceof IExpression) { - return fgLPExpression; + return (T) fgLPExpression; } if (adaptableObject instanceof IRegisterGroup) { - return fgLPRegisterGroup; + return (T) fgLPRegisterGroup; } if (adaptableObject instanceof IMemoryBlock) { - return fgLPMemoryBlock; + return (T) fgLPMemoryBlock; } if (adaptableObject instanceof IBreakpoint) { - return fgLPBreakpoint; + return (T) fgLPBreakpoint; } if (adaptableObject instanceof IBreakpointContainer) { - return fgLPBreakpointContainer; + return (T) fgLPBreakpointContainer; } - return fgLPDebugElement; + return (T) fgLPDebugElement; } if (adapterType.equals(IModelProxyFactory.class)) { @@ -249,72 +252,72 @@ public class DebugElementAdapterFactory implements IAdapterFactory { adaptableObject instanceof DefaultBreakpointsViewInput || adaptableObject instanceof IBreakpoint || adaptableObject instanceof IBreakpointContainer) { - return fgModelProxyFactoryAdapter; + return (T) fgModelProxyFactoryAdapter; } } if (adapterType.equals(ISourceDisplay.class)) { if (adaptableObject instanceof IStackFrame) { - return fgStackFrameSourceDisplayAdapter; + return (T) fgStackFrameSourceDisplayAdapter; } } if (adapterType.equals(IModelSelectionPolicyFactory.class)) { if (adaptableObject instanceof IDebugElement) { - return fgModelSelectionPolicyFactoryAdapter; + return (T) fgModelSelectionPolicyFactoryAdapter; } } if (adapterType.equals(IColumnPresentationFactory.class)) { if (adaptableObject instanceof IStackFrame || adaptableObject instanceof IExpressionManager) { - return fgVariableColumnFactory; + return (T) fgVariableColumnFactory; } } if (adapterType.equals(IElementMementoProvider.class)) { if (adaptableObject instanceof IStackFrame) { - return fgMPFrame; + return (T) fgMPFrame; } if (adaptableObject instanceof IVariable) { - return fgMPVariable; + return (T) fgMPVariable; } if (adaptableObject instanceof IRegisterGroup) { - return fgMPRegisterGroup; + return (T) fgMPRegisterGroup; } if (adaptableObject instanceof IExpression) { - return fgMPExpression; + return (T) fgMPExpression; } if (adaptableObject instanceof IExpressionManager) { - return fgMPExpressionManager; + return (T) fgMPExpressionManager; } if (adaptableObject instanceof IMemoryBlockRetrieval) { - return fgMPMemory; + return (T) fgMPMemory; } if (adaptableObject instanceof IBreakpoint) { - return fgMPBreakpoint; + return (T) fgMPBreakpoint; } if (adaptableObject instanceof IBreakpointContainer) { - return fgMPBreakpointContainer; + return (T) fgMPBreakpointContainer; } if (adaptableObject instanceof DefaultBreakpointsViewInput) { - return fgMPBreakpointManagerInput; + return (T) fgMPBreakpointManagerInput; } } if (adapterType.equals(IElementEditor.class)) { if (adaptableObject instanceof IVariable) { - return fgEEVariable; + return (T) fgEEVariable; } if (adaptableObject instanceof IWatchExpression) { - return fgEEWatchExpression; + return (T) fgEEWatchExpression; } } if (adapterType.equals(IViewerInputProvider.class)) { if (adaptableObject instanceof IStackFrame) { - return fgStackFrameViewerInputProvider; + return (T) fgStackFrameViewerInputProvider; } else { - return fgDefaultViewerInputProvider; + return (T) fgDefaultViewerInputProvider; } } @@ -325,7 +328,7 @@ public class DebugElementAdapterFactory implements IAdapterFactory { * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() */ @Override - public Class[] getAdapterList() { + public Class<?>[] getAdapterList() { return new Class[] { IAsynchronousLabelAdapter.class, IAsynchronousContentAdapter.class, diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java index 570fe9ebb..1d08d4f88 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java @@ -1386,7 +1386,7 @@ public class LaunchView extends AbstractDebugView Object object = selection.getFirstElement(); if (object instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) object; - IShowInSource show = (IShowInSource) adaptable.getAdapter(IShowInSource.class); + IShowInSource show = adaptable.getAdapter(IShowInSource.class); if (show != null) { return show.getShowInContext(); } @@ -1407,7 +1407,7 @@ public class LaunchView extends AbstractDebugView Object object = selection.getFirstElement(); if (object instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) object; - IShowInTargetList show = (IShowInTargetList) adaptable.getAdapter(IShowInTargetList.class); + IShowInTargetList show = adaptable.getAdapter(IShowInTargetList.class); if (show != null) { return show.getShowInTargetIds(); } @@ -1524,7 +1524,7 @@ public class LaunchView extends AbstractDebugView @Override public synchronized void viewerUpdatesBegin() { IWorkbenchSiteProgressService progressService = - (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class); + getSite().getAdapter(IWorkbenchSiteProgressService.class); if (progressService != null) { progressService.incrementBusy(); } @@ -1536,7 +1536,7 @@ public class LaunchView extends AbstractDebugView @Override public synchronized void viewerUpdatesComplete() { IWorkbenchSiteProgressService progressService = - (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class); + getSite().getAdapter(IWorkbenchSiteProgressService.class); if (progressService != null) { progressService.decrementBusy(); } |