Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2015-02-20 07:08:00 -0500
committerDani Megert2015-02-20 07:08:00 -0500
commit035b16c4845dde58ab3f6463878cbe662349e58c (patch)
treea312725ef6ac6c4aeedc3ca81bad03b0583f5fb1 /org.eclipse.debug.ui/ui/org/eclipse/debug/ui
parent87bf3db976790862ceb9b321661e0234afb342ca (diff)
downloadeclipse.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/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java2
13 files changed, 49 insertions, 33 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
index 5d3709a4c..33b81d5d2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
@@ -80,7 +80,7 @@ public abstract class DebugPopup extends PopupDialog {
protected String getInfoText() {
if (getCommandId() != null && getActionText() != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
- IBindingService bindingService = (IBindingService) workbench.getAdapter(IBindingService.class);
+ IBindingService bindingService = workbench.getAdapter(IBindingService.class);
String formattedBinding = bindingService.getBestActiveBindingFormattedFor(getCommandId());
String infoText = null;
@@ -198,7 +198,7 @@ public abstract class DebugPopup extends PopupDialog {
}
};
- fHandlerService = (IHandlerService) workbench.getAdapter(IHandlerService.class);
+ fHandlerService = workbench.getAdapter(IHandlerService.class);
fActivation = fHandlerService.activateHandler(commandId, fCloseHandler);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
index cb5b1b94e..c6c85731e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.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
@@ -19,8 +19,10 @@ import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.core.commands.operations.IUndoContext;
import org.eclipse.core.commands.operations.IUndoableOperation;
import org.eclipse.core.commands.operations.ObjectUndoContext;
+
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -29,6 +31,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -57,6 +60,7 @@ import org.eclipse.debug.internal.ui.memory.MemoryRenderingManager;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIUtils;
import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
+
import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetManager;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextManager;
@@ -64,15 +68,18 @@ import org.eclipse.debug.ui.contexts.IDebugContextService;
import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
import org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser;
import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
+
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
+
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
+
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
@@ -309,10 +316,11 @@ public class DebugUITools {
IAdaptable context= null;
if (shell != null) {
context= new IAdaptable() {
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter == Shell.class) {
- return shell;
+ return (T) shell;
}
return null;
}
@@ -477,7 +485,7 @@ public class DebugUITools {
}
if (context != null) {
- return (IProcess) context.getAdapter(IProcess.class);
+ return context.getAdapter(IProcess.class);
}
return null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
index 3f7c9bff8..328285370 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
@@ -457,7 +457,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
IAdaptable[] elements = workingSet.getElements();
IResource[] resources = new IResource[elements.length];
for (int i = 0; i < resources.length; i++) {
- resources[i]= (IResource) elements[i].getAdapter(IResource.class);
+ resources[i]= elements[i].getAdapter(IResource.class);
}
return RefreshUtil.toMemento(resources);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
index bd3ef6b95..892e30696 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
@@ -272,7 +272,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
}
else if (elmt instanceof IAdaptable)
{
- target = (IAddMemoryRenderingsTarget)((IAdaptable)elmt).getAdapter(IAddMemoryRenderingsTarget.class);
+ target = ((IAdaptable)elmt).getAdapter(IAddMemoryRenderingsTarget.class);
}
return target;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
index b09b9fdbf..05ad9edd1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
@@ -133,14 +133,14 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
fCallerAction = callerAction;
fCallerAction.setMenuCreator(this);
- fEditor= (ITextEditor)(targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class));
+ fEditor= targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class);
if (fEditor != null) {
if (fEditor instanceof ITextEditorExtension) {
((ITextEditorExtension) fEditor).addRulerContextMenuListener(this);
}
- fRulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
+ fRulerInfo= fEditor.getAdapter(IVerticalRulerInfo.class);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
index d735d34c4..0372d40f3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
@@ -194,7 +194,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
IWorkbenchWindow workbenchWindow = part.getSite().getWorkbenchWindow();
IDebugContextService service = manager.getContextService(workbenchWindow);
service.addDebugContextListener(fContextListener);
- fPartTarget = (IRunToLineTarget) part.getAdapter(IRunToLineTarget.class);
+ fPartTarget = part.getAdapter(IRunToLineTarget.class);
if (fPartTarget == null) {
IAdapterManager adapterManager = Platform.getAdapterManager();
// TODO: we could restrict loading to cases when the debugging context is on
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
index 4db1b058c..7e6222cb4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
@@ -73,7 +73,7 @@ public class RunToLineHandler implements IDebugEventSetListener, IBreakpointMana
if (source instanceof IThread && event.getKind() == DebugEvent.SUSPEND &&
event.getDetail() == DebugEvent.BREAKPOINT) {
IThread thread = (IThread) source;
- IDebugTarget suspendee = (IDebugTarget) thread.getAdapter(IDebugTarget.class);
+ IDebugTarget suspendee = thread.getAdapter(IDebugTarget.class);
if (fTarget.equals(suspendee)) {
// cleanup if the breakpoint was hit or not
cancel();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
index 8a4c9c8a6..f41cad7f3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
@@ -178,7 +178,7 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
return provider.getDocument(editor.getEditorInput());
}
- IDocument doc = (IDocument) fPart.getAdapter(IDocument.class);
+ IDocument doc = fPart.getAdapter(IDocument.class);
if (doc != null) {
return doc;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
index aa3d73139..32962f107 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
@@ -86,7 +86,7 @@ public class FileLink implements IConsoleHyperlink {
if (editorPart instanceof ITextEditor) {
textEditor = (ITextEditor) editorPart;
} else {
- textEditor = (ITextEditor) editorPart.getAdapter(ITextEditor.class);
+ textEditor = editorPart.getAdapter(ITextEditor.class);
}
if (textEditor != null) {
IEditorInput input = editorPart.getEditorInput();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
index cb4f4823d..935614696 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
@@ -106,7 +106,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
fContainer = container;
fMemoryBlock = block;
- fLabelDecorator = (ILabelDecorator)fMemoryBlock.getAdapter(ILabelDecorator.class);
+ fLabelDecorator = fMemoryBlock.getAdapter(ILabelDecorator.class);
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
index 2db7b143b..a7f80721d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 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
@@ -16,6 +16,7 @@ import java.math.BigInteger;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
@@ -42,8 +43,10 @@ import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingConte
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLabelProvider;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLabelProviderEx;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLine;
+
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -51,8 +54,10 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
+
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.TextViewer;
+
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.CellEditor;
@@ -63,6 +68,7 @@ import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TextCellEditor;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.TableCursor;
@@ -97,6 +103,7 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
+
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PropertyDialogAction;
@@ -1037,7 +1044,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
else
{
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = getMemoryBlock().getAdapter(IPersistableDebugElement.class);
int defaultColSize = -1;
if (elmt != null)
@@ -1079,7 +1086,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
else
{
int defaultRowSize = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = getMemoryBlock().getAdapter(IPersistableDebugElement.class);
if (elmt != null)
{
if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL))
@@ -1103,7 +1110,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private int getDefaultFromPersistableElement(String propertyId) {
int defaultValue = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = getMemoryBlock().getAdapter(IPersistableDebugElement.class);
if (elmt != null)
{
try {
@@ -3426,23 +3433,24 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (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 == IColorProvider.class) {
- return getColorProviderAdapter();
+ return (T) getColorProviderAdapter();
}
if (adapter == ILabelProvider.class) {
- return getLabelProviderAdapter();
+ return (T) getLabelProviderAdapter();
}
if (adapter == IFontProvider.class) {
- return getFontProviderAdapter();
+ return (T) getFontProviderAdapter();
}
if (adapter == IMemoryBlockTablePresentation.class) {
- return getTablePresentationAdapter();
+ return (T) getTablePresentationAdapter();
}
if (adapter == IWorkbenchAdapter.class)
@@ -3471,7 +3479,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
};
}
- return fWorkbenchAdapter;
+ return (T) fWorkbenchAdapter;
}
if (adapter == IMemoryBlockConnection.class) {
@@ -3537,7 +3545,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
};
}
- return fConnection;
+ return (T) fConnection;
}
return super.getAdapter(adapter);
@@ -3587,7 +3595,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
protected IColorProvider getColorProviderAdapter()
{
- return (IColorProvider)getMemoryBlock().getAdapter(IColorProvider.class);
+ return getMemoryBlock().getAdapter(IColorProvider.class);
}
/**
@@ -3604,7 +3612,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
protected ILabelProvider getLabelProviderAdapter()
{
- return (ILabelProvider)getMemoryBlock().getAdapter(ILabelProvider.class);
+ return getMemoryBlock().getAdapter(ILabelProvider.class);
}
/**
@@ -3621,7 +3629,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
protected IFontProvider getFontProviderAdapter()
{
- return (IFontProvider)getMemoryBlock().getAdapter(IFontProvider.class);
+ return getMemoryBlock().getAdapter(IFontProvider.class);
}
/**
@@ -3636,7 +3644,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
protected IMemoryBlockTablePresentation getTablePresentationAdapter()
{
- return (IMemoryBlockTablePresentation)getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
+ return getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
}
private boolean isDynamicLoad()
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
index 36ef02631..e6a338181 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
@@ -182,11 +182,11 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
return;
}
if (selection.getAdapter(ILaunch.class) != null ) {
- launch = (ILaunch) selection.getAdapter(ILaunch.class);
+ launch = selection.getAdapter(ILaunch.class);
locator = launch.getSourceLocator();
}
else if (selection.getAdapter(IDebugElement.class) != null ) {
- launch = ((IDebugElement)selection.getAdapter(IDebugElement.class)).getLaunch();
+ launch = selection.getAdapter(IDebugElement.class).getLaunch();
locator = launch.getSourceLocator();
}
else {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
index 62ada047d..de724381b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
@@ -96,7 +96,7 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
ArrayList<ISourceContainer> locationList = new ArrayList<ISourceContainer>();
for (int i = 0; i < elements.length; i++) {
- IResource resource = (IResource) elements[i].getAdapter(IResource.class);
+ IResource resource = elements[i].getAdapter(IResource.class);
if (resource != null) {
switch (resource.getType()) {

Back to the top