diff options
Diffstat (limited to 'org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java index 1a27397d2..df1929382 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.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 @@ -18,6 +18,7 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.Status; + import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; @@ -345,27 +346,28 @@ public class RuntimeProcess extends PlatformObject implements IProcess { /* (non-Javadoc) * @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) { if (adapter.equals(IProcess.class)) { - return this; + return (T) this; } if (adapter.equals(IDebugTarget.class)) { ILaunch launch = getLaunch(); IDebugTarget[] targets = launch.getDebugTargets(); for (int i = 0; i < targets.length; i++) { if (this.equals(targets[i].getProcess())) { - return targets[i]; + return (T) targets[i]; } } return null; } if (adapter.equals(ILaunch.class)) { - return getLaunch(); + return (T) getLaunch(); } //CONTEXTLAUNCHING if(adapter.equals(ILaunchConfiguration.class)) { - return getLaunch().getLaunchConfiguration(); + return (T) getLaunch().getLaunchConfiguration(); } return super.getAdapter(adapter); } |