diff options
Diffstat (limited to 'org.eclipse.debug.core/core/org/eclipse/debug/internal/core')
5 files changed, 25 insertions, 21 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java index c72eb51af..1b28178e3 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 IBM Corporation and others. + * Copyright (c) 2004, 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 @@ -242,7 +242,7 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi } } else { - IMemoryBlockRetrieval mbRetrieval = (IMemoryBlockRetrieval) block.getAdapter(IMemoryBlockRetrieval.class); + IMemoryBlockRetrieval mbRetrieval = block.getAdapter(IMemoryBlockRetrieval.class); // standard memory block always uses the debug target as the memory block retrieval if (mbRetrieval == null) { mbRetrieval = block.getDebugTarget(); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java index c6aa374f0..443e98f10 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.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 @@ -62,7 +62,7 @@ public class StepFilterManager implements ILaunchListener { */ @Override public void launchChanged(ILaunch launch) { - IStepFiltersHandler command = (IStepFiltersHandler)launch.getAdapter(IStepFiltersHandler.class); + IStepFiltersHandler command = launch.getAdapter(IStepFiltersHandler.class); if (command != null) { command.execute(new DebugCommandRequest(new Object[]{launch})); } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java index b257db3cc..4adad0f18 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 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 @@ -11,6 +11,7 @@ package org.eclipse.debug.internal.core; import org.eclipse.core.runtime.Platform; + import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; @@ -229,13 +230,14 @@ public class WatchExpression implements IWatchExpression { /** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { //CONTEXTLAUNCHING if(adapter.equals(ILaunchConfiguration.class)) { ILaunch launch = getLaunch(); if(launch != null) { - return launch.getLaunchConfiguration(); + return (T) launch.getLaunchConfiguration(); } } return Platform.getAdapterManager().getAdapter(this, adapter); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java index ce7a82c2c..179ada39a 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -11,6 +11,7 @@ package org.eclipse.debug.internal.core.commands; import org.eclipse.core.runtime.IAdapterFactory; + import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.commands.IDisconnectHandler; import org.eclipse.debug.core.commands.IDropToFrameHandler; @@ -51,54 +52,55 @@ public class CommandAdapterFactory implements IAdapterFactory { /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) */ + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Object adaptableObject, Class adapterType) { + public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (IStepFiltersHandler.class.equals(adapterType)) { if (adaptableObject instanceof IDebugElement || adaptableObject instanceof ILaunch || adaptableObject instanceof IProcess) { - return fgStepFiltersCommand; + return (T) fgStepFiltersCommand; } } if (ITerminateHandler.class.equals(adapterType)) { if (adaptableObject instanceof ITerminate) { - return fgTerminateCommand; + return (T) fgTerminateCommand; } } if (IStepOverHandler.class.equals(adapterType)) { if (adaptableObject instanceof IStep) { - return fgStepOverCommand; + return (T) fgStepOverCommand; } } if (IStepIntoHandler.class.equals(adapterType)) { if (adaptableObject instanceof IStep) { - return fgStepIntoCommand; + return (T) fgStepIntoCommand; } } if (IStepReturnHandler.class.equals(adapterType)) { if (adaptableObject instanceof IStep) { - return fgStepReturnCommand; + return (T) fgStepReturnCommand; } } if (ISuspendHandler.class.equals(adapterType)) { if (adaptableObject instanceof ISuspendResume) { - return fgSuspendCommand; + return (T) fgSuspendCommand; } } if (IResumeHandler.class.equals(adapterType)) { if (adaptableObject instanceof ISuspendResume) { - return fgResumeCommand; + return (T) fgResumeCommand; } } if (IDisconnectHandler.class.equals(adapterType)) { if (adaptableObject instanceof IDisconnect) { - return fgDisconnectCommand; + return (T) fgDisconnectCommand; } } if (IDropToFrameHandler.class.equals(adapterType)) { if (adaptableObject instanceof IDropToFrame) { - return fgDropToFrameCommand; + return (T) fgDropToFrameCommand; } } return null; @@ -108,7 +110,7 @@ public class CommandAdapterFactory implements IAdapterFactory { * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() */ @Override - public Class[] getAdapterList() { + public Class<?>[] getAdapterList() { return new Class[]{ ITerminateHandler.class, IStepOverHandler.class, diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java index 147ec25b3..0cf2c6a58 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -67,7 +67,7 @@ public abstract class StepCommand extends AbstractDebugCommand { if (object instanceof IStackFrame) { frame = (IStackFrame) object; } else if (object instanceof IAdaptable) { - frame = (IStackFrame)((IAdaptable)object).getAdapter(IStackFrame.class); + frame = ((IAdaptable)object).getAdapter(IStackFrame.class); } if (frame != null) { if (!threads.add(frame.getThread())) { |