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
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(..)
-rw-r--r--org.eclipse.debug.core/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java10
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java20
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java4
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java4
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java26
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java4
-rw-r--r--org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.debug.examples.ui/pom.xml4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java34
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java22
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java12
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java8
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java17
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java17
-rw-r--r--org.eclipse.debug.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java68
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java8
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java13
-rw-r--r--org.eclipse.debug.ui/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java99
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java21
-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
-rw-r--r--org.eclipse.ui.console/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java17
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java10
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java4
113 files changed, 592 insertions, 468 deletions
diff --git a/org.eclipse.debug.core/META-INF/MANIFEST.MF b/org.eclipse.debug.core/META-INF/MANIFEST.MF
index 417c848dd..1d265416a 100644
--- a/org.eclipse.debug.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.core/META-INF/MANIFEST.MF
@@ -19,7 +19,7 @@ Export-Package: org.eclipse.debug.core,
org.eclipse.debug.internal.core.variables;x-friends:="org.eclipse.debug.ui,org.eclipse.jdt.debug.ui"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.9.0,4.0.0)";visibility:=reexport,
org.eclipse.core.variables;bundle-version="[3.2.800,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
index 8f54e9cbb..1c0c8ccd9 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.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
@@ -19,6 +19,7 @@ import java.util.List;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.PlatformObject;
+
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IDisconnect;
import org.eclipse.debug.core.model.IProcess;
@@ -584,14 +585,15 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter.equals(ILaunch.class)) {
- return this;
+ return (T) this;
}
//CONTEXTLAUNCHING
if(adapter.equals(ILaunchConfiguration.class)) {
- return getLaunchConfiguration();
+ return (T) getLaunchConfiguration();
}
return super.getAdapter(adapter);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java
index 71e606570..4f8fa16a2 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 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.core.model;
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;
@@ -62,30 +63,31 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- @Override
- public Object getAdapter(Class adapter) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter == IDebugElement.class) {
- return this;
+ return (T) this;
}
// a debug target may not implement IStepFilters
if (adapter == IStepFilters.class) {
if (getDebugTarget() instanceof IStepFilters) {
- return getDebugTarget();
+ return (T) getDebugTarget();
}
}
if (adapter == IDebugTarget.class) {
- return getDebugTarget();
+ return (T) getDebugTarget();
}
if (adapter == ILaunch.class) {
- return getLaunch();
+ return (T) getLaunch();
}
if (adapter == IProcess.class) {
- return getDebugTarget().getProcess();
+ return (T) getDebugTarget().getProcess();
}
//CONTEXTLAUNCHING
if(adapter == ILaunchConfiguration.class) {
- return getLaunch().getLaunchConfiguration();
+ return (T) getLaunch().getLaunchConfiguration();
}
return super.getAdapter(adapter);
}
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);
}
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())) {
diff --git a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
index 4da298606..b9f6282ac 100644
--- a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
@@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.debug.examples.ui;singleton:=true
-Bundle-Version: 1.4.200.qualifier
+Bundle-Version: 1.4.300.qualifier
Bundle-Activator: org.eclipse.debug.examples.ui.pda.DebugUIPlugin
-Require-Bundle: org.eclipse.core.runtime,
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
org.eclipse.core.resources,
org.eclipse.debug.core;bundle-version="3.9.0",
org.eclipse.ui,
diff --git a/org.eclipse.debug.examples.ui/pom.xml b/org.eclipse.debug.examples.ui/pom.xml
index 3a5eeee65..ff5890bfe 100644
--- a/org.eclipse.debug.examples.ui/pom.xml
+++ b/org.eclipse.debug.examples.ui/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2013 Eclipse Foundation and others.
+ Copyright (c) 2012, 2015 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.debug</groupId>
<artifactId>org.eclipse.debug.examples.ui</artifactId>
- <version>1.4.200-SNAPSHOT</version>
+ <version>1.4.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java
index b3dfbbead..db3b6ab71 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -15,6 +15,7 @@ import javax.sound.midi.MidiEvent;
import javax.sound.midi.Track;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.core.commands.IStepOverHandler;
import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch;
import org.eclipse.debug.examples.core.midi.launcher.SequencerControl;
@@ -50,63 +51,64 @@ public class MidiAdapterFactory implements IAdapterFactory {
private static IModelProxyFactory fgCheckboxModelProxyFactory = new CheckboxModelProxyFactory();
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IElementContentProvider.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
- return fgSequencerContentProvider;
+ return (T) fgSequencerContentProvider;
}
if (adaptableObject instanceof Track) {
- return fgTackContentProvider;
+ return (T) fgTackContentProvider;
}
}
if (IElementLabelProvider.class.equals(adapterType)) {
if (adaptableObject instanceof Track) {
- return fgTrackLabelProvider;
+ return (T) fgTrackLabelProvider;
}
if (adaptableObject instanceof SequencerControl) {
- return fgControlLabelProvider;
+ return (T) fgControlLabelProvider;
}
if (adaptableObject instanceof MidiEvent) {
- return fgMidiEventLabelProvdier;
+ return (T) fgMidiEventLabelProvdier;
}
}
if (IColumnPresentationFactory.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
- return fgSequencerColumnFactory;
+ return (T) fgSequencerColumnFactory;
}
if (adaptableObject instanceof Track) {
- return fgTrackColumnFactory;
+ return (T) fgTrackColumnFactory;
}
}
if (IElementEditor.class.equals(adapterType)) {
if (adaptableObject instanceof SequencerControl) {
- return new ControlEditor();
+ return (T) new ControlEditor();
}
}
if (IModelProxyFactory.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
- return fgSequencerModelProxyFactory;
+ return (T) fgSequencerModelProxyFactory;
} else if (adaptableObject instanceof Track) {
- return fgCheckboxModelProxyFactory;
+ return (T) fgCheckboxModelProxyFactory;
} else if (adaptableObject instanceof MidiEvent) {
- return fgCheckboxModelProxyFactory;
+ return (T) fgCheckboxModelProxyFactory;
}
}
if (IElementMementoProvider.class.equals(adapterType)) {
- return fgMementoProvider;
+ return (T) fgMementoProvider;
}
if (IStepOverHandler.class.equals(adapterType)) {
- return fgStepOverHandler;
+ return (T) fgStepOverHandler;
}
return null;
}
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IElementContentProvider.class, IElementLabelProvider.class, IStepOverHandler.class,};
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java
index 02a382c5c..b7b756f46 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Bjorn Freeman-Benson - initial API and implementation
@@ -12,6 +12,7 @@
package org.eclipse.debug.examples.ui.pda.adapters;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
import org.eclipse.debug.examples.core.pda.model.PDAStackFrame;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
@@ -20,38 +21,39 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewActionProvid
/**
- *
+ *
* @since 3.2
*
*/
public class AdapterFactory implements IAdapterFactory {
-
+
private static IElementContentProvider fgTargetAdapter = new PDADebugTargetContentProvider();
private static IModelProxyFactory fgFactory = new ModelProxyFactory();
private static IViewActionProvider fgViewActionProvider = new PDAViewActionProvider();
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IElementContentProvider.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
- return fgTargetAdapter;
+ return (T) fgTargetAdapter;
}
}
if (IModelProxyFactory.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
- return fgFactory;
+ return (T) fgFactory;
}
}
if (IViewActionProvider.class.equals(adapterType)) {
if (adaptableObject instanceof PDAStackFrame) {
- return fgViewActionProvider;
+ return (T) fgViewActionProvider;
}
}
return null;
}
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IElementContentProvider.class, IModelProxyFactory.class, IViewActionProvider.class};
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
index 3eed074e3..e3da52e57 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
+ * Copyright (c) 2009, 2015 Wind River Systems 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.examples.ui.pda.adapters;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.core.commands.IRestartHandler;
import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
@@ -24,18 +25,19 @@ public class CommandAdapterFactory implements IAdapterFactory {
private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand();
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IRestartHandler.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
- return fgRestartHandler;
+ return (T) fgRestartHandler;
}
}
return null;
}
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IRestartHandler.class};
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
index ca4706959..1486e78ff 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -42,7 +42,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
ITextEditor textEditor = getEditor(part);
if (textEditor != null) {
- IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IResource.class);
+ IResource resource = textEditor.getEditorInput().getAdapter(IResource.class);
ITextSelection textSelection = (ITextSelection) selection;
int lineNumber = textSelection.getStartLine();
IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugCorePlugin.ID_PDA_DEBUG_MODEL);
@@ -80,7 +80,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
private ITextEditor getEditor(IWorkbenchPart part) {
if (part instanceof ITextEditor) {
ITextEditor editorPart = (ITextEditor) part;
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
if (resource != null) {
String extension = resource.getFileExtension();
if (extension != null && extension.equals("pda")) { //$NON-NLS-1$
@@ -113,7 +113,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
ITextEditor editorPart = (ITextEditor)part;
int lineNumber = ((ITextSelection)selection).getStartLine();
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
String var = variableAndFunctionName[0];
String fcn = variableAndFunctionName[1];
toggleWatchpoint(resource, lineNumber, fcn, var, true, true);
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
index a81d6d2c8..22243aabd 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -12,10 +12,14 @@
package org.eclipse.debug.examples.ui.pda.breakpoints;
import org.eclipse.core.resources.IResource;
+
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.examples.ui.pda.editor.PDAEditor;
+
import org.eclipse.debug.ui.actions.IRunToLineTarget;
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
+
import org.eclipse.ui.texteditor.ITextEditor;
@@ -26,22 +30,23 @@ public class PDAEditorAdapterFactory 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 (adaptableObject instanceof PDAEditor) {
ITextEditor editorPart = (ITextEditor) adaptableObject;
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
if (resource != null) {
String extension = resource.getFileExtension();
if (extension != null && extension.equals("pda")) { //$NON-NLS-1$
if (adapterType.equals(IToggleBreakpointsTarget.class)) {
- return new PDABreakpointAdapter();
+ return (T) new PDABreakpointAdapter();
}
//#ifdef ex7
//# // TODO: Exercise 7 - create run to line adapter
//#else
if (adapterType.equals(IRunToLineTarget.class)) {
- return new PDARunToLineAdapter();
+ return (T) new PDARunToLineAdapter();
}
//#endif
}
@@ -53,7 +58,7 @@ public class PDAEditorAdapterFactory implements IAdapterFactory {
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IToggleBreakpointsTarget.class};
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java
index 9855de3c2..6a9eecdd9 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -47,7 +47,7 @@ public class PDARunToLineAdapter implements IRunToLineTarget {
int lineNumber = textSelection.getStartLine() + 1;
if (lineNumber > 0) {
if (target instanceof IAdaptable) {
- IDebugTarget debugTarget = (IDebugTarget) ((IAdaptable)target).getAdapter(IDebugTarget.class);
+ IDebugTarget debugTarget = ((IAdaptable)target).getAdapter(IDebugTarget.class);
if (debugTarget != null) {
//#ifdef ex7
//# // TODO: Exercise 7 - perform the run-to-line with a run-to-line breakpoint and handler
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
index 2e716724c..d799e50bf 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -72,7 +72,7 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
// current source line.
ITextEditor editorPart = (ITextEditor)part;
int lineNumber = ((ITextSelection)selection).getStartLine();
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
String var = variableAndFunctionName[0];
String fcn = variableAndFunctionName[1];
toggleWatchpoint(resource, lineNumber, fcn, var, fAccessModeEnabled, fModificationModeEnabled);
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java
index c937d1493..b2b0ee939 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Wind River Systems and others.
+ * Copyright (c) 2008, 2015 Wind River Systems 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - bug fixing
@@ -18,26 +18,25 @@ import org.eclipse.debug.examples.core.pda.model.PDAStackFrame;
import org.eclipse.debug.examples.core.pda.model.PDAThread;
/**
- * Property tester for use with standard expressions to determine whether
+ * Property tester for use with standard expressions to determine whether
* the given debug target can perform a push operation.
*/
public class CanPushTester extends PropertyTester {
-
+
private static final String CAN_PUSH_PROPERTY = "canPush"; //$NON-NLS-1$
-
+
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (CAN_PUSH_PROPERTY.equals(property)) {
if (receiver instanceof IAdaptable) {
- PDADebugElement element = (PDADebugElement)
- ((IAdaptable)receiver).getAdapter(PDADebugElement.class);
+ PDADebugElement element = ((IAdaptable) receiver).getAdapter(PDADebugElement.class);
PDAThread thread = null;
if (element instanceof PDAThread) {
thread = (PDAThread)element;
} else if (element instanceof PDAStackFrame) {
thread = (PDAThread)((PDAStackFrame)element).getThread();
- }
-
+ }
+
if (thread != null) {
return thread.canPushData();
}
diff --git a/org.eclipse.debug.tests/META-INF/MANIFEST.MF b/org.eclipse.debug.tests/META-INF/MANIFEST.MF
index a7168199b..93bfb3619 100644
--- a/org.eclipse.debug.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.tests/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 3.9.200.qualifier
Bundle-Activator: org.eclipse.debug.tests.TestsPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.10.0,4.0.0)",
org.junit,
org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)",
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
index 1e5155548..94b162520 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -39,15 +39,15 @@ import org.eclipse.ui.IEditorInput;
/**
* Test the ordering used in the breakpoints view.
- *
+ *
* Using a special Comparator which sorts breakpoint texts like file:1, file:2 and file:11 in a numerical ordering.
*/
public class BreakpointOrderingTests extends TestCase {
-
+
public BreakpointOrderingTests(String name) {
super(name);
}
-
+
/**
* Test only implementation of IBreakpoint.
*/
@@ -59,7 +59,7 @@ public class BreakpointOrderingTests extends TestCase {
TestBreakpoint(String text) {
this(text, IBreakpoint.BREAKPOINT_MARKER);
}
-
+
TestBreakpoint(String text, final String markerType) {
fText = text;
final IResource resource = ResourcesPlugin.getWorkspace().getRoot();
@@ -77,14 +77,14 @@ public class BreakpointOrderingTests extends TestCase {
catch ( CoreException e ) {
fail("Unexpected exception: " + e.toString()); //$NON-NLS-1$
}
-
+
}
-
+
void ReportFailure(String msg) throws CoreException {
throw new CoreException(new Status(IStatus.ERROR, TestsPlugin.PLUGIN_ID, msg));
}
-
-
+
+
String getText() {
return fText;
}
@@ -141,11 +141,11 @@ public class BreakpointOrderingTests extends TestCase {
@Override
public void setRegistered(boolean registered) throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
-
+
}
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}
@@ -160,7 +160,7 @@ public class BreakpointOrderingTests extends TestCase {
TestLineBreakpoint(String text, int lineNum) {
super(text, IBreakpoint.LINE_BREAKPOINT_MARKER);
- fLineNum = lineNum;
+ fLineNum = lineNum;
}
@Override
@@ -233,9 +233,9 @@ public class BreakpointOrderingTests extends TestCase {
public Control getControl() {
fail("not implemented in test"); //$NON-NLS-1$
return null;
- }};
-
- // Test debug model presentation for label text retrieval.
+ }};
+
+ // Test debug model presentation for label text retrieval.
IDebugModelPresentation fDebugModelPres = new IDebugModelPresentation() {
@Override
@@ -256,7 +256,7 @@ public class BreakpointOrderingTests extends TestCase {
}
@Override
- public void setAttribute(String attribute, Object value) {
+ public void setAttribute(String attribute, Object value) {
fail("not implemented in test"); //$NON-NLS-1$
}
@@ -292,10 +292,10 @@ public class BreakpointOrderingTests extends TestCase {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}};
-
+
// Test vector with some UNIX paths
TestBreakpoint[] createTestBreakpoints0() {
- TestBreakpoint[] fTestBps = {
+ TestBreakpoint[] fTestBps = {
new TestBreakpoint(""), //$NON-NLS-1$
new TestBreakpoint("/file/text.c"), //$NON-NLS-1$
new TestBreakpoint("/file/text.c:1"), //$NON-NLS-1$
@@ -317,11 +317,11 @@ public class BreakpointOrderingTests extends TestCase {
new TestLineBreakpoint("/file/text.c:y", 0), //$NON-NLS-1$
};
return fTestBps;
- }
-
- // Check plain numbers
+ }
+
+ // Check plain numbers
TestBreakpoint[] createTestBreakpoints1() {
- TestBreakpoint[] fTestBps = {
+ TestBreakpoint[] fTestBps = {
new TestLineBreakpoint("0", 0), //$NON-NLS-1$
new TestLineBreakpoint("1", 1), //$NON-NLS-1$
new TestLineBreakpoint("1_a", 1), //$NON-NLS-1$
@@ -337,11 +337,11 @@ public class BreakpointOrderingTests extends TestCase {
new TestLineBreakpoint("112b", 112), //$NON-NLS-1$
};
return fTestBps;
- }
-
+ }
+
// Test consistent behavior with leading 0's
TestBreakpoint[] createTestBreakpoints2() {
- TestBreakpoint[] fTestBps = {
+ TestBreakpoint[] fTestBps = {
new TestLineBreakpoint("0", 0), //$NON-NLS-1$
new TestLineBreakpoint("00", 0), //$NON-NLS-1$
new TestLineBreakpoint("0000", 0), //$NON-NLS-1$
@@ -351,18 +351,18 @@ public class BreakpointOrderingTests extends TestCase {
new TestLineBreakpoint("10000", 10000), //$NON-NLS-1$
};
return fTestBps;
- }
-
+ }
+
// Test Win32 paths
TestBreakpoint[] createTestBreakpoints3() {
- TestBreakpoint[] fTestBps = {
+ TestBreakpoint[] fTestBps = {
new TestLineBreakpoint(":a", 0), //$NON-NLS-1$
new TestLineBreakpoint("c:\\file\\text.c:1", 1), //$NON-NLS-1$
new TestLineBreakpoint("c:\\file\\text.c:2", 2), //$NON-NLS-1$
new TestLineBreakpoint("d:\\file\\text.c:3", 3), //$NON-NLS-1$
};
return fTestBps;
- }
+ }
public void testBreakpointOrdering0() throws CoreException {
executeTest(createTestBreakpoints0());
@@ -376,7 +376,7 @@ public class BreakpointOrderingTests extends TestCase {
public void testBreakpointOrdering3() throws CoreException {
executeTest(createTestBreakpoints3());
}
-
+
/**
* Test expected ordering.
@@ -400,14 +400,14 @@ public class BreakpointOrderingTests extends TestCase {
if (!ltCheck) {
System.err.println("Less Comparison in between " + inner + " and " + outer + " (" + testBps[inner].getText() + " and " + testBps[outer].getText() + ") failed"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
failed = true;
- }
- }
+ }
+ }
}
assertFalse(failed);
} finally {
for (int index = 0; index < testBps.length; index++) {
testBps[index].delete();
}
- }
+ }
}
} \ No newline at end of file
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java
index 2e6da1a2c..2db408a54 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/TestStackFrame.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 IBM Corporation and others.
+ * Copyright (c) 2014, 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
@@ -42,7 +42,7 @@ public class TestStackFrame implements IStackFrame {
}
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
return null;
}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java
index dd0c7e019..6298dc1b2 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlock.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -17,7 +17,7 @@ import org.eclipse.debug.core.model.IMemoryBlock;
/**
* Dummy memory block implementation.
- *
+ *
* @since 3.1
*/
public class MemoryBlock implements IMemoryBlock {
@@ -94,7 +94,7 @@ public class MemoryBlock implements IMemoryBlock {
* @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.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
index 5ed32d5f0..7ec70948f 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 Wind River Systems and others.
+ * Copyright (c) 2009, 2015 Wind River Systems 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
@@ -17,6 +17,7 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.core.runtime.PlatformObject;
+
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
@@ -38,10 +39,13 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
+
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
+
import org.eclipse.swt.widgets.Display;
+
import org.junit.Assert;
/**
@@ -78,10 +82,11 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
return fModel;
}
- @Override
- public Object getAdapter(Class adapter) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter.isInstance(fModel)) {
- return fModel;
+ return (T) fModel;
}
return null;
}
diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index 03f95a7e7..d11bb5907 100644
--- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -83,7 +83,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
index 37419aadb..6c950b2f0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
@@ -43,10 +43,10 @@ public class DebugModelPropertyTester extends PropertyTester {
if (MODEL_TYPE_PROPERTY.equals(property)){
IDebugTarget target = null;
if(receiver instanceof IProcess) {
- target = (IDebugTarget) ((IProcess)receiver).getAdapter(IDebugTarget.class);
+ target = ((IProcess)receiver).getAdapter(IDebugTarget.class);
}
else if(receiver instanceof IDebugElement) {
- target = (IDebugTarget) ((IDebugElement)receiver).getAdapter(IDebugTarget.class);
+ target = ((IDebugElement)receiver).getAdapter(IDebugTarget.class);
}
if(target != null) {
// check that the expected value argument is valid
@@ -60,10 +60,10 @@ public class DebugModelPropertyTester extends PropertyTester {
}
IDebugModelProvider modelProvider = null;
if (receiver instanceof IAdaptable) {
- modelProvider = (IDebugModelProvider) ((IAdaptable)receiver).getAdapter(IDebugModelProvider.class);
+ modelProvider = ((IAdaptable)receiver).getAdapter(IDebugModelProvider.class);
} else {
modelProvider =
- (IDebugModelProvider) Platform.getAdapterManager().
+ Platform.getAdapterManager().
getAdapter(receiver, IDebugModelProvider.class);
}
if (modelProvider != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
index 49b09b5bf..008d024ec 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 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
@@ -12,10 +12,12 @@ package org.eclipse.debug.internal.ui;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainerWorkbenchAdapter;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointPersistableElementAdapter;
+
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.model.IWorkbenchAdapter2;
@@ -25,27 +27,28 @@ public class DebugUIAdapterFactory implements IAdapterFactory {
/**
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(Object, Class)
*/
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Object obj, Class adapterType) {
+ public <T> T getAdapter(Object obj, Class<T> adapterType) {
if (adapterType.isInstance(obj)) {
- return obj;
+ return (T) obj;
}
if (adapterType == IPersistableElement.class) {
if (obj instanceof IBreakpoint) {
- return new BreakpointPersistableElementAdapter((IBreakpoint)obj);
+ return (T) new BreakpointPersistableElementAdapter((IBreakpoint)obj);
}
}
if (adapterType == IWorkbenchAdapter.class) {
if (obj instanceof IBreakpointContainer) {
- return new BreakpointContainerWorkbenchAdapter();
+ return (T) new BreakpointContainerWorkbenchAdapter();
}
}
if (adapterType == IWorkbenchAdapter2.class) {
if (obj instanceof IBreakpointContainer) {
- return new BreakpointContainerWorkbenchAdapter();
+ return (T) new BreakpointContainerWorkbenchAdapter();
}
}
@@ -56,7 +59,7 @@ public class DebugUIAdapterFactory implements IAdapterFactory {
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[] {IPersistableElement.class, IWorkbenchAdapter.class, IWorkbenchAdapter2.class};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
index b0c876923..198430846 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.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
@@ -73,7 +73,7 @@ public class DefaultLabelProvider implements ILabelProvider {
return null;
}
if (key == null && element instanceof IAdaptable) {
- IWorkbenchAdapter de= (IWorkbenchAdapter) ((IAdaptable) element).getAdapter(IWorkbenchAdapter.class);
+ IWorkbenchAdapter de= ((IAdaptable) element).getAdapter(IWorkbenchAdapter.class);
if (de != null) {
ImageDescriptor descriptor= de.getImageDescriptor(element);
if( descriptor != null) {
@@ -298,7 +298,7 @@ public class DefaultLabelProvider implements ILabelProvider {
public String getAdapterLabel(Object object) {
if (object instanceof IAdaptable) {
- IWorkbenchAdapter de= (IWorkbenchAdapter) ((IAdaptable) object).getAdapter(IWorkbenchAdapter.class);
+ IWorkbenchAdapter de= ((IAdaptable) object).getAdapter(IWorkbenchAdapter.class);
if (de != null) {
return de.getLabel(object);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
index 1b8b97e1e..aec606b2e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 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
@@ -48,10 +48,10 @@ public class ResourceExtender extends PropertyTester {
*/
@Override
public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
- IResource resource = (IResource) ((IAdaptable) receiver).getAdapter(IResource.class);
+ IResource resource = ((IAdaptable) receiver).getAdapter(IResource.class);
if (resource == null) {
if (PROPERTY_MATCHES_CONTENT_TYPE.equals(method)) {
- IPathEditorInput editorInput = (IPathEditorInput) ((IAdaptable) receiver).getAdapter(IPathEditorInput.class);
+ IPathEditorInput editorInput = ((IAdaptable) receiver).getAdapter(IPathEditorInput.class);
if (editorInput != null) {
IPath path= editorInput.getPath();
File file= path.toFile();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
index ebe3fbc8c..6d2078c39 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.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
@@ -120,7 +120,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
@Override
public void init(IViewPart view) {
setView(view);
- fProgressService = (IWorkbenchSiteProgressService) view.getAdapter(IWorkbenchSiteProgressService.class);
+ fProgressService = view.getAdapter(IWorkbenchSiteProgressService.class);
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
index 8de05528a..aaa58be3c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.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
@@ -65,7 +65,7 @@ public class AddToFavoritesAction extends SelectionListenerAction {
Object object = selection.getFirstElement();
ILaunch launch = null;
if (object instanceof IAdaptable) {
- launch = (ILaunch)((IAdaptable)object).getAdapter(ILaunch.class);
+ launch = ((IAdaptable)object).getAdapter(ILaunch.class);
}
if (launch == null) {
if (object instanceof ILaunch) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
index 0bfbb4b55..9131390b5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.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
@@ -61,7 +61,7 @@ public class EditLaunchConfigurationAction extends SelectionListenerAction {
Object object = selection.getFirstElement();
ILaunch launch = null;
if (object instanceof IAdaptable) {
- launch = (ILaunch)((IAdaptable)object).getAdapter(ILaunch.class);
+ launch = ((IAdaptable)object).getAdapter(ILaunch.class);
}
if (launch == null) {
if (object instanceof ILaunch) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
index 02c03f87f..842403363 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 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
@@ -64,7 +64,7 @@ public class LaunchablePropertyTester extends PropertyTester {
if (element instanceof IResource) {
resource = (IResource) element;
} else if (element instanceof IAdaptable) {
- resource = (IResource) ((IAdaptable)element).getAdapter(IResource.class);
+ resource = ((IAdaptable)element).getAdapter(IResource.class);
}
return resource;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
index fc047374d..a66d4f5a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.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
@@ -161,9 +161,9 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
@Override
public void partActivated(IWorkbenchPart part) {
fActivePart = part;
- IResource resource = (IResource) part.getAdapter(IResource.class);
+ IResource resource = part.getAdapter(IResource.class);
if (resource == null && part instanceof IEditorPart) {
- resource = (IResource) ((IEditorPart)part).getEditorInput().getAdapter(IResource.class);
+ resource = ((IEditorPart)part).getEditorInput().getAdapter(IResource.class);
}
if (resource != null) {
fTargetAdapter = getAdapter(resource);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
index 1baa069a2..a920aa945 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.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
@@ -32,7 +32,7 @@ public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
@Override
public void init(IViewPart view) {
fView = view;
- IDebugView debugView = (IDebugView) getView().getAdapter(IDebugView.class);
+ IDebugView debugView = getView().getAdapter(IDebugView.class);
if (debugView != null) {
debugView.setAction(getActionId(), getAction());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
index 19789ebd7..1d3f5ddc5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -315,8 +315,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
if (adaptable != null) {
IToggleBreakpointsTarget adapter = null;
if (adaptable instanceof IAdaptable) {
- adapter = (IToggleBreakpointsTarget)
- ((IAdaptable)adaptable).getAdapter(IToggleBreakpointsTarget.class);
+ adapter = ((IAdaptable)adaptable).getAdapter(IToggleBreakpointsTarget.class);
}
if (adapter == null) {
IAdapterManager adapterManager = Platform.getAdapterManager();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
index 29697f14c..407beb12a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.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
@@ -198,7 +198,7 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
debugTargets.add(targets[j]);
}
} else if (next instanceof IProcess) {
- IDebugTarget target= (IDebugTarget)((IProcess)next).getAdapter(IDebugTarget.class);
+ IDebugTarget target= ((IProcess)next).getAdapter(IDebugTarget.class);
if (target != null) {
debugTargets.add(target);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
index da603a1b4..a5de1715f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.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
@@ -82,7 +82,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
public void run(){
IWorkbenchSiteProgressService progressService = null;
if (fPart != null) {
- progressService = (IWorkbenchSiteProgressService)fPart.getSite().
+ progressService = fPart.getSite().
getAdapter(IWorkbenchSiteProgressService.class);
}
final boolean enabled = !getBreakpointManager().isEnabled();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
index 9e2edc535..17f06b692 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.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
@@ -101,7 +101,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
if (element instanceof IWatchExpression) {
return (IWatchExpression)element;
} else if (element instanceof IAdaptable) {
- return (IWatchExpression)((IAdaptable)element).getAdapter(IWatchExpression.class);
+ return ((IAdaptable)element).getAdapter(IWatchExpression.class);
}
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
index a2a00d0ca..2ca6e9ebe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.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
@@ -40,7 +40,7 @@ public class RemoveExpressionAction extends AbstractSelectionActionDelegate {
if (segment instanceof IExpression) {
expressions.add((IExpression) segment);
} else if (segment instanceof IAdaptable) {
- IExpression expression = (IExpression)((IAdaptable)segment).getAdapter(IExpression.class);
+ IExpression expression = ((IAdaptable)segment).getAdapter(IExpression.class);
if (expression != null) {
expressions.add(expression);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
index 55972bc6f..237fd5aef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.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
@@ -72,7 +72,7 @@ public abstract class WatchExpressionAction implements IViewActionDelegate {
if (element instanceof IWatchExpression) {
list.add(element);
} else if (element instanceof IAdaptable) {
- IWatchExpression expr = (IWatchExpression)((IAdaptable)element).getAdapter(IWatchExpression.class);
+ IWatchExpression expr = ((IAdaptable)element).getAdapter(IWatchExpression.class);
if (expr != null) {
list.add(expr);
} else {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
index b2d8fd139..c06864c84 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Wind River Systems and others.
+ * Copyright (c) 2008, 2015 Wind River Systems 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
@@ -119,7 +119,7 @@ public class WatchHandler extends AbstractHandler {
* @return factory or <code>null</code>
*/
static IWatchExpressionFactoryAdapter getFactory(IVariable variable) {
- return (IWatchExpressionFactoryAdapter) variable.getAdapter(IWatchExpressionFactoryAdapter.class);
+ return variable.getAdapter(IWatchExpressionFactoryAdapter.class);
}
/**
@@ -130,7 +130,7 @@ public class WatchHandler extends AbstractHandler {
*/
static IWatchExpressionFactoryAdapter2 getFactory2(Object element) {
if (element instanceof IAdaptable) {
- return (IWatchExpressionFactoryAdapter2)((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class);
+ return ((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class);
}
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
index 681bd7a08..23bcdded0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 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 ShowTypesAction extends Action {
return;
}
- IDebugModelPresentation debugLabelProvider= (IDebugModelPresentation)getView().getAdapter(IDebugModelPresentation.class);
+ IDebugModelPresentation debugLabelProvider= getView().getAdapter(IDebugModelPresentation.class);
if (debugLabelProvider != null) {
Boolean typesStatus = on ? Boolean.TRUE : Boolean.FALSE;
debugLabelProvider.setAttribute(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
index 35052121c..f417fa4b0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.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
@@ -112,7 +112,7 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
// singleton manager
private static DebugModelContextBindingManager fgManager;
- private static IContextService fgContextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
+ private static IContextService fgContextService = PlatformUI.getWorkbench().getAdapter(IContextService.class);
public static DebugModelContextBindingManager getDefault() {
if (fgManager == null) {
@@ -300,7 +300,7 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
*/
private String[] getDebugModelIds(Object object) {
if (object instanceof IAdaptable) {
- IDebugModelProvider modelProvider= (IDebugModelProvider)((IAdaptable)object).getAdapter(IDebugModelProvider.class);
+ IDebugModelProvider modelProvider= ((IAdaptable)object).getAdapter(IDebugModelProvider.class);
if (modelProvider != null) {
String[] modelIds= modelProvider.getModelIdentifiers();
if (modelIds != null) {
@@ -324,7 +324,7 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
public static ILaunch getLaunch(Object object) {
ILaunch launch = null;
if (object instanceof IAdaptable) {
- launch = (ILaunch) ((IAdaptable)object).getAdapter(ILaunch.class);
+ launch = ((IAdaptable)object).getAdapter(ILaunch.class);
}
if (launch == null && object instanceof IDebugElement) {
launch = ((IDebugElement) object).getLaunch();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
index 4302aed21..3621dbe9d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -88,7 +88,7 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
Object source = event.getSource();
if (source instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) source;
- ILaunch launch = (ILaunch) adaptable.getAdapter(ILaunch.class);
+ ILaunch launch = adaptable.getAdapter(ILaunch.class);
if (fLaunch.equals(launch)) {
// only notify for this launch
notifySuspend(event);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
index d542267b9..22440d2e7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 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,7 +14,9 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.core.ILaunch;
+
import org.eclipse.debug.ui.contexts.ISuspendTrigger;
/**
@@ -27,8 +29,9 @@ public class SuspendTriggerAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
@Override
- public synchronized Object getAdapter(Object adaptableObject, Class adapterType) {
+ public synchronized <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adapterType.equals(ISuspendTrigger.class)) {
if (adaptableObject instanceof ILaunch) {
LaunchSuspendTrigger trigger = fSuspendTriggers.get(adaptableObject);
@@ -36,7 +39,7 @@ public class SuspendTriggerAdapterFactory implements IAdapterFactory {
trigger = new LaunchSuspendTrigger((ILaunch) adaptableObject, this);
fSuspendTriggers.put(adaptableObject, trigger);
}
- return trigger;
+ return (T) trigger;
}
}
return null;
@@ -46,7 +49,7 @@ public class SuspendTriggerAdapterFactory implements IAdapterFactory {
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{ISuspendTrigger.class};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
index ffa412b99..d2a8c279a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.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
@@ -112,7 +112,7 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
AbstractAsyncTableRendering rendering = getTableRendering(context);
if (rendering != null) {
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) rendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = rendering.getAdapter(TableRenderingContentDescriptor.class);
if (descriptor == null) {
return new Object[0];
@@ -232,7 +232,7 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
throw e;
}
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) tableRendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = tableRendering.getAdapter(TableRenderingContentDescriptor.class);
if (descriptor == null) {
return new Object[0];
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
index 9324f12f6..eca235333 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
@@ -52,7 +52,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
{
AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = tableRendering.getAdapter(TableRenderingContentDescriptor.class);
if (descriptor != null)
{
String addressStr = getColumnText(element, 0, tableRendering, descriptor);
@@ -63,7 +63,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
for (int i=0; i<=numColumns; i++)
{
- labels[i+1] = getColumnText(element, i+1, tableRendering, (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class));
+ labels[i+1] = getColumnText(element, i+1, tableRendering, tableRendering.getAdapter(TableRenderingContentDescriptor.class));
}
labels[labels.length - 1 ] = IInternalDebugCoreConstants.EMPTY_STRING;
@@ -79,7 +79,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
if (columnIndex == 0)
{
- IMemoryBlockTablePresentation presentation = (IMemoryBlockTablePresentation)tableRendering.getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
+ IMemoryBlockTablePresentation presentation = tableRendering.getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
if (presentation != null)
{
String rowLabel = presentation.getRowLabel(tableRendering.getMemoryBlock(), ((MemorySegment)element).getAddress());
@@ -116,7 +116,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
- ILabelProvider labelProvider = (ILabelProvider)tableRendering.getAdapter(ILabelProvider.class);
+ ILabelProvider labelProvider = tableRendering.getAdapter(ILabelProvider.class);
if (labelProvider != null && columnIndex > 0)
{
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
@@ -173,7 +173,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
if (segment.getBytes().length != tableRendering.getBytesPerLine())
return null;
- ILabelProvider labelProvider = (ILabelProvider)tableRendering.getAdapter(ILabelProvider.class);
+ ILabelProvider labelProvider = tableRendering.getAdapter(ILabelProvider.class);
if (labelProvider != null && columnIndex > 0)
{
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
@@ -243,7 +243,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
if (segment.getBytes().length != tableRendering.getBytesPerLine())
return null;
- IFontProvider fontProvider = (IFontProvider)tableRendering.getAdapter(IFontProvider.class);
+ IFontProvider fontProvider = tableRendering.getAdapter(IFontProvider.class);
if (fontProvider != null && columnIndex > 0)
{
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
@@ -296,7 +296,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
if (segment.getBytes().length != tableRendering.getBytesPerLine())
return null;
- IColorProvider colorProvider = (IColorProvider)tableRendering.getAdapter(IColorProvider.class);
+ IColorProvider colorProvider = tableRendering.getAdapter(IColorProvider.class);
if (colorProvider != null && columnIndex > 0)
{
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
@@ -321,7 +321,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
if (segment.getBytes().length != tableRendering.getBytesPerLine())
return null;
- IColorProvider colorProvider = (IColorProvider)tableRendering.getAdapter(IColorProvider.class);
+ IColorProvider colorProvider = tableRendering.getAdapter(IColorProvider.class);
if (colorProvider != null && columnIndex > 0)
{
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
index d759e4421..d2788ec3b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
@@ -974,7 +974,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
return isSharedConfig(((IEditorPart) receiver).getEditorInput());
}
else if (receiver instanceof IAdaptable) {
- IFile file = (IFile) ((IAdaptable)receiver).getAdapter(IFile.class);
+ IFile file = ((IAdaptable)receiver).getAdapter(IFile.class);
if (file != null) {
return isSharedConfig(file);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
index 0e1acb39e..ab8e23e1b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
@@ -117,7 +117,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
* Registers command handlers for launch shortcut key bindings
*/
private void registerLaunchCommandHandlers() {
- IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
+ IHandlerService handlerService = PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
if(handlerService != null) {
for (String mode : getModes()) {
String id = getId() + "." + mode; //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 8e13a460e..a73e12a44 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -304,7 +304,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*/
@Override
public synchronized void launchRemoved(final ILaunch launch) {
- ISuspendTrigger trigger = (ISuspendTrigger) launch.getAdapter(ISuspendTrigger.class);
+ ISuspendTrigger trigger = launch.getAdapter(ISuspendTrigger.class);
if (trigger != null) {
trigger.removeSuspendTriggerListener(this);
}
@@ -339,7 +339,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*/
@Override
public synchronized void launchAdded(ILaunch launch) {
- ISuspendTrigger trigger = (ISuspendTrigger) launch.getAdapter(ISuspendTrigger.class);
+ ISuspendTrigger trigger = launch.getAdapter(ISuspendTrigger.class);
if (trigger != null) {
trigger.addSuspendTriggerListener(this);
}
@@ -502,7 +502,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
String type = launchConfiguration.getType().getIdentifier();
ViewContextService service = ViewContextManager.getDefault().getService(window);
if (service != null) {
- IContextService contextServce = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
+ IContextService contextServce = PlatformUI.getWorkbench().getAdapter(IContextService.class);
String[] ids = service.getEnabledPerspectives();
IContextActivation[] activations = new IContextActivation[ids.length];
for (int i = 0; i < ids.length; i++) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
index 33707720c..f3238546b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
@@ -235,7 +235,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
for(int i = 0; i < pages.length; i++) {
IEditorPart[] eparts = pages[i].getDirtyEditors();
for(int j = 0; j < eparts.length; j++) {
- IResource resource = (IResource)eparts[j].getEditorInput().getAdapter(IResource.class);
+ IResource resource = eparts[j].getEditorInput().getAdapter(IResource.class);
if(resource != null) {
for(int k = 0; k < projects.length; k++) {
if(projects[k].equals(resource.getProject())) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
index d57ce7108..c63c28fa0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
@@ -101,7 +101,7 @@ public class WorkingSetsFilter extends ViewerFilter {
for(int i = 0; i < wsets.length; i++) {
IAdaptable[] elements = wsets[i].getElements();
for(int j = 0; j < elements.length; j++) {
- lres = (IResource)elements[j].getAdapter(IResource.class);
+ lres = elements[j].getAdapter(IResource.class);
if(lres != null) {
if(parents.contains(lres)) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index e7bc9874a..fd0a4f73b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.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
@@ -22,12 +22,14 @@ import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
+
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
@@ -63,6 +65,7 @@ import org.eclipse.debug.internal.ui.views.memory.renderings.ReformatAction;
import org.eclipse.debug.internal.ui.views.memory.renderings.ResetToBaseAddressAction;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
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.debug.ui.memory.AbstractTableRendering;
@@ -74,6 +77,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
import org.eclipse.debug.ui.memory.MemoryRenderingElement;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -83,8 +87,10 @@ import org.eclipse.jface.dialogs.IDialogConstants;
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;
@@ -98,6 +104,7 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TextCellEditor;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.StyledText;
@@ -129,6 +136,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.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
@@ -1293,7 +1301,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
columnSize = syncColSize;
}
} else {
- IPersistableDebugElement elmt = (IPersistableDebugElement) getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = getMemoryBlock().getAdapter(IPersistableDebugElement.class);
int defaultColSize = -1;
if (elmt != null) {
@@ -1329,7 +1337,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
} 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)) {
defaultRowSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL);
@@ -1371,7 +1379,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
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 {
Object valueMB = elmt.getProperty(this, propertyId);
@@ -1933,23 +1941,24 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#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 == IModelChangedListener.class) {
- return fModelChangedListener;
+ return (T) fModelChangedListener;
}
if (adapter == IWorkbenchAdapter.class) {
@@ -1977,11 +1986,11 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
};
}
- return fWorkbenchAdapter;
+ return (T) fWorkbenchAdapter;
}
if (adapter == TableRenderingContentDescriptor.class) {
- return getContentDescriptor();
+ return (T) getContentDescriptor();
}
return super.getAdapter(adapter);
@@ -2675,7 +2684,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* <code>null</code>
*/
protected IColorProvider getColorProviderAdapter() {
- return (IColorProvider) getMemoryBlock().getAdapter(IColorProvider.class);
+ return getMemoryBlock().getAdapter(IColorProvider.class);
}
/**
@@ -2692,7 +2701,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* <code>null</code>
*/
protected ILabelProvider getLabelProviderAdapter() {
- return (ILabelProvider) getMemoryBlock().getAdapter(ILabelProvider.class);
+ return getMemoryBlock().getAdapter(ILabelProvider.class);
}
/**
@@ -2709,7 +2718,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* <code>null</code>
*/
protected IFontProvider getFontProviderAdapter() {
- return (IFontProvider) getMemoryBlock().getAdapter(IFontProvider.class);
+ return getMemoryBlock().getAdapter(IFontProvider.class);
}
/**
@@ -2724,7 +2733,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* <code>null</code>
*/
protected IMemoryBlockTablePresentation getTablePresentationAdapter() {
- return (IMemoryBlockTablePresentation) getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
+ return getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
}
/**
@@ -3178,8 +3187,8 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fActivated = true;
IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
- IContextService contextSupport = (IContextService) workbench.getAdapter(IContextService.class);
+ ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
+ IContextService contextSupport = workbench.getAdapter(IContextService.class);
if (commandSupport != null && contextSupport != null) {
fContext.add(contextSupport.activateContext(ID_ASYNC_TABLE_RENDERING_CONTEXT));
@@ -3217,7 +3226,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private void activatePageActions() {
IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
+ ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
if (commandSupport != null) {
Command nextPage = commandSupport.getCommand(ID_NEXT_PAGE_COMMAND);
if (fNextPageHandler == null) {
@@ -3252,8 +3261,8 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fActivated = false;
IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
- IContextService contextSupport = (IContextService) workbench.getAdapter(IContextService.class);
+ ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
+ IContextService contextSupport = workbench.getAdapter(IContextService.class);
if (commandSupport != null && contextSupport != null) {
// remove handler
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java
index 3ca3eaf7f..87869f7ed 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java
@@ -109,7 +109,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
FontData fontData = super.getFontData(elementPath, presentationContext, columnId);
if (fontData == null && element instanceof IAdaptable) {
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) ((IAdaptable)element).getAdapter(IWorkbenchAdapter2.class);
+ IWorkbenchAdapter2 adapter = ((IAdaptable)element).getAdapter(IWorkbenchAdapter2.class);
if (adapter != null) {
fontData = adapter.getFont(element);
}
@@ -124,7 +124,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
RGB rgb = super.getForeground(elementPath, presentationContext, columnId);
if (rgb == null && element instanceof IAdaptable) {
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) ((IAdaptable)element).getAdapter(IWorkbenchAdapter2.class);
+ IWorkbenchAdapter2 adapter = ((IAdaptable)element).getAdapter(IWorkbenchAdapter2.class);
if (adapter != null) {
rgb = adapter.getForeground(element);
}
@@ -139,7 +139,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
RGB rgb = super.getBackground(elementPath, presentationContext, columnId);
if (rgb == null && element instanceof IAdaptable) {
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) ((IAdaptable)element).getAdapter(IWorkbenchAdapter2.class);
+ IWorkbenchAdapter2 adapter = ((IAdaptable)element).getAdapter(IWorkbenchAdapter2.class);
if (adapter != null) {
rgb = adapter.getBackground(element);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java
index 9f4c8dbb6..2c0ea6529 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java
@@ -34,7 +34,7 @@ public class BreakpointContainerMementoProvider extends DebugElementMementoProvi
IBreakpointContainer container = (IBreakpointContainer) element;
IAdaptable category = container.getCategory();
if (category != null) {
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) category.getAdapter(IWorkbenchAdapter.class);
+ IWorkbenchAdapter adapter = category.getAdapter(IWorkbenchAdapter.class);
if (adapter != null) {
return adapter.getLabel(category);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 8d7282b73..0fc5d434b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -832,7 +832,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
debugTargets.add(targets[j]);
}
} else if (next instanceof IProcess) {
- IDebugTarget target = (IDebugTarget)((IProcess)next).getAdapter(IDebugTarget.class);
+ IDebugTarget target = ((IProcess)next).getAdapter(IDebugTarget.class);
if (target != null) {
debugTargets.add(target);
}
@@ -840,7 +840,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
// Allow non-standard debug model element return an IDebugTarget
// element that could be used for implementing breakpoint filtering.
// Bug 333517.
- IDebugTarget target = (IDebugTarget) ((IAdaptable)next).getAdapter(IDebugTarget.class);
+ IDebugTarget target = ((IAdaptable)next).getAdapter(IDebugTarget.class);
if (target != null) {
debugTargets.add(target);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
index 636736c5f..02e030911 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
@@ -304,7 +304,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
if (element instanceof IResource) {
resource = (IResource) element;
} else if (element instanceof IAdaptable) {
- resource = (IResource) ((IAdaptable)element).getAdapter(IResource.class);
+ resource = ((IAdaptable)element).getAdapter(IResource.class);
}
return resource;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
index b49bd641f..e8f2429fb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 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.ui.sourcelookup;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.ui.model.IWorkbenchAdapter;
/**
@@ -22,10 +23,11 @@ public class SourceContainerAdapterFactory 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 (adapterType.equals(IWorkbenchAdapter.class)) {
- return new SourceContainerWorkbenchAdapter();
+ return (T) new SourceContainerWorkbenchAdapter();
}
return null;
}
@@ -33,7 +35,7 @@ public class SourceContainerAdapterFactory implements IAdapterFactory {
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[] {IWorkbenchAdapter.class};
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
index fba3c1fd0..55e76d4c9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 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.ui.sourcelookup;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.ui.model.IWorkbenchAdapter;
/**
@@ -22,10 +23,11 @@ public class SourceElementAdapterFactory 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 (adapterType.equals(IWorkbenchAdapter.class)) {
- return new SourceElementWorkbenchAdapter();
+ return (T) new SourceElementWorkbenchAdapter();
}
return null;
}
@@ -33,7 +35,7 @@ public class SourceElementAdapterFactory implements IAdapterFactory {
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[] {IWorkbenchAdapter.class};
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
index 3326190b9..d69938957 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
@@ -434,7 +434,7 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
if (editor instanceof ITextEditor) {
textEditor = (ITextEditor)editor;
} else {
- textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+ textEditor = editor.getAdapter(ITextEditor.class);
}
if (textEditor != null) {
positionEditor(textEditor, frame);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
index d21dc2118..873088856 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -86,11 +86,11 @@ public class SourceLookupService implements IDebugContextListener, ISourceDispla
public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context;
- ISourceDisplay adapter = (ISourceDisplay) adaptable.getAdapter(ISourceDisplay.class);
+ ISourceDisplay adapter = adaptable.getAdapter(ISourceDisplay.class);
if (adapter == null && !(context instanceof PlatformObject)) {
// for objects that don't properly subclass PlatformObject to inherit default
// adapters, just delegate to the adapter factory
- adapter = (ISourceDisplay) new DebugElementAdapterFactory().getAdapter(context, ISourceDisplay.class);
+ adapter = new DebugElementAdapterFactory().getAdapter(context, ISourceDisplay.class);
}
if (adapter != null) {
adapter.displaySource(context, page, forceSourceLookup);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
index dce7853fa..2644dc4ba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
@@ -151,7 +151,7 @@ public class SelectedResourceManager {
IWorkbenchPart part = page.getActivePart();
if(part instanceof IEditorPart) {
IEditorPart epart = (IEditorPart) part;
- resource = (IResource) epart.getEditorInput().getAdapter(IResource.class);
+ resource = epart.getEditorInput().getAdapter(IResource.class);
}
else if(part != null) {
IWorkbenchPartSite site = part.getSite();
@@ -165,7 +165,7 @@ public class SelectedResourceManager {
Iterator<?> iterator = ss.iterator();
while (iterator.hasNext() && resource == null) {
Object next = iterator.next();
- resource = (IResource) Platform.getAdapterManager().getAdapter(next, IResource.class);
+ resource = Platform.getAdapterManager().getAdapter(next, IResource.class);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
index d24d85179..484d10354 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
@@ -258,7 +258,7 @@ public abstract class AsynchronousModel {
adapter = (IModelProxyFactory) element;
} else if (element instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) element;
- adapter = (IModelProxyFactory) adaptable.getAdapter(IModelProxyFactory.class);
+ adapter = adaptable.getAdapter(IModelProxyFactory.class);
}
return adapter;
}
@@ -438,7 +438,7 @@ public abstract class AsynchronousModel {
adapter = (IAsynchronousLabelAdapter) element;
} else if (element instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) element;
- adapter = (IAsynchronousLabelAdapter) adaptable.getAdapter(IAsynchronousLabelAdapter.class);
+ adapter = adaptable.getAdapter(IAsynchronousLabelAdapter.class);
}
// if no adapter, use default (i.e. model presentation)
if (adapter == null) {
@@ -461,7 +461,7 @@ public abstract class AsynchronousModel {
adapter = (IAsynchronousContentAdapter) element;
} else if (element instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) element;
- adapter = (IAsynchronousContentAdapter) adaptable.getAdapter(IAsynchronousContentAdapter.class);
+ adapter = adaptable.getAdapter(IAsynchronousContentAdapter.class);
}
return adapter;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
index 1f4b9d06d..6a256f403 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
@@ -584,7 +584,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
Object element = ss.getFirstElement();
if (element instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) element;
- IModelSelectionPolicyFactory factory = (IModelSelectionPolicyFactory) adaptable.getAdapter(IModelSelectionPolicyFactory.class);
+ IModelSelectionPolicyFactory factory = adaptable.getAdapter(IModelSelectionPolicyFactory.class);
if (factory != null) {
return factory.createModelSelectionPolicyAdapter(adaptable, getPresentationContext());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
index 15b304571..9ec884a25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 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
@@ -57,7 +57,7 @@ public class ViewerAdapterService {
IElementLabelProvider lp = (IElementLabelProvider)getAdapter(element, IElementLabelProvider.class);
if (lp == null && element instanceof String) {
// there are no adapters registered for Strings
- return (IElementLabelProvider) new DebugElementAdapterFactory().getAdapter(element, IElementLabelProvider.class);
+ return new DebugElementAdapterFactory().getAdapter(element, IElementLabelProvider.class);
}
return lp;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
index 74244bf03..224182bd4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
@@ -112,7 +112,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
@Override
protected boolean initialize(IAction action, ISelection selection) {
if (!isInitialized()) {
- IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
+ IDebugView adapter= getView().getAdapter(IDebugView.class);
if (adapter != null) {
if (adapter.getViewer() instanceof TreeModelViewer) {
setViewer((TreeModelViewer) adapter.getViewer());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
index e56f6d3b1..a39b75c56 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
@@ -623,7 +623,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
*/
ViewContextService(IWorkbenchWindow window) {
fWindow = window;
- fContextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
+ fContextService = PlatformUI.getWorkbench().getAdapter(IContextService.class);
fDebugContextService = DebugUITools.getDebugContextManager().getContextService(fWindow);
loadContextToViewExtensions();
applyUserViewBindings();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
index cdd141032..b6cfeb3c2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.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
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
+
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer;
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointOrganizer;
@@ -29,6 +30,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+
import org.eclipse.debug.ui.IDebugUIConstants;
/**
@@ -660,7 +662,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
return Platform.getAdapterManager().getAdapter(this, adapter);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
index 7a0c9dd2e..1aededf79 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
@@ -43,7 +43,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
if (category != null) {
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) category.getAdapter(IWorkbenchAdapter.class);
+ IWorkbenchAdapter adapter = category.getAdapter(IWorkbenchAdapter.class);
if (adapter != null) {
return adapter.getImageDescriptor(category);
}
@@ -62,7 +62,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
if (category != null) {
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) category.getAdapter(IWorkbenchAdapter.class);
+ IWorkbenchAdapter adapter = category.getAdapter(IWorkbenchAdapter.class);
if (adapter != null) {
return adapter.getLabel(category);
}
@@ -88,7 +88,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) category.getAdapter(IWorkbenchAdapter2.class);
+ IWorkbenchAdapter2 adapter = category.getAdapter(IWorkbenchAdapter2.class);
if (adapter != null) {
return adapter.getForeground(category);
}
@@ -104,7 +104,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) category.getAdapter(IWorkbenchAdapter2.class);
+ IWorkbenchAdapter2 adapter = category.getAdapter(IWorkbenchAdapter2.class);
if (adapter != null) {
return adapter.getBackground(category);
}
@@ -120,7 +120,7 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) category.getAdapter(IWorkbenchAdapter2.class);
+ IWorkbenchAdapter2 adapter = category.getAdapter(IWorkbenchAdapter2.class);
if (adapter != null) {
return adapter.getFont(category);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
index 41af99aa5..3ff9bc666 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
@@ -51,7 +51,7 @@ public class BreakpointPersistableElementAdapter implements IPersistableElement
IMarker marker = fBreakpoint.getMarker();
if (marker != null) {
IResource resource = marker.getResource();
- IPersistableElement pe = (IPersistableElement) resource.getAdapter(IPersistableElement.class);
+ IPersistableElement pe = resource.getAdapter(IPersistableElement.class);
if (pe != null) {
long id = marker.getId();
String longString = Long.toString(id);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
index 2f419f2df..f90031689 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
@@ -34,7 +34,7 @@ public class BreakpointTypeOrganizer extends AbstractBreakpointOrganizerDelegate
*/
@Override
public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- IBreakpointTypeCategory category = (IBreakpointTypeCategory) breakpoint.getAdapter(IBreakpointTypeCategory.class);
+ IBreakpointTypeCategory category = breakpoint.getAdapter(IBreakpointTypeCategory.class);
if (category != null) {
return new IAdaptable[]{category};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
index bce1bbffe..972e41ed2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
@@ -61,7 +61,7 @@ public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDe
if (!IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(workingSets[i].getId())) {
IAdaptable[] elements = workingSets[i].getElements();
for (int j = 0; j < elements.length; j++) {
- IResource resource = (IResource) elements[j].getAdapter(IResource.class);
+ IResource resource = elements[j].getAdapter(IResource.class);
if (resource != null) {
if (parents.contains(resource)) {
result.add(new WorkingSetCategory(workingSets[i]));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
index 31276641a..4052537dd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.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
@@ -14,6 +14,7 @@ import java.io.IOException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
+
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
@@ -24,14 +25,17 @@ import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.debug.core.model.IStreamsProxy2;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
+
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
+
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
@@ -161,19 +165,20 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- @Override
- public Object getAdapter(Class required) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> required) {
if (IShowInSource.class.equals(required)) {
- return this;
+ return (T) this;
}
if (IShowInTargetList.class.equals(required)) {
- return this;
+ return (T) this;
}
//CONTEXTLAUNCHING
if(ILaunchConfiguration.class.equals(required)) {
ILaunch launch = getProcess().getLaunch();
if(launch != null) {
- return launch.getLaunchConfiguration();
+ return (T) launch.getLaunchConfiguration();
}
return null;
}
@@ -189,7 +194,7 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
if (process == null) {
return null;
}
- IDebugTarget target = (IDebugTarget)process.getAdapter(IDebugTarget.class);
+ IDebugTarget target = process.getAdapter(IDebugTarget.class);
ISelection selection = null;
if (target == null) {
selection = new TreeSelection(new TreePath(new Object[]{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
index 874c04be6..7a6671672 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
@@ -206,7 +206,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
if (target instanceof IExpression) {
return (IExpression)target;
} else if (target instanceof IAdaptable) {
- return (IExpression)((IAdaptable)target).getAdapter(IExpression.class);
+ return ((IAdaptable)target).getAdapter(IExpression.class);
}
return null;
}
@@ -500,7 +500,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
* @return factory or <code>null</code>
*/
private IWatchExpressionFactoryAdapter getFactory(IVariable variable) {
- return (IWatchExpressionFactoryAdapter) variable.getAdapter(IWatchExpressionFactoryAdapter.class);
+ return variable.getAdapter(IWatchExpressionFactoryAdapter.class);
}
/**
@@ -511,7 +511,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
*/
private IWatchExpressionFactoryAdapter2 getFactory2(Object element) {
if (element instanceof IAdaptable) {
- return (IWatchExpressionFactoryAdapter2)((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class);
+ return ((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class);
}
return null;
}
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();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
index 38e1906d9..6756edd30 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
@@ -516,7 +516,7 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
}
// ask decorator to decorate to ensure consistent label
- ILabelDecorator decorator = (ILabelDecorator) fMemoryBlocks[i].getAdapter(ILabelDecorator.class);
+ ILabelDecorator decorator = fMemoryBlocks[i].getAdapter(ILabelDecorator.class);
if (decorator != null)
text = decorator.decorateText(text, fMemoryBlocks[i]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
index 2957f11e4..c14df2012 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
@@ -78,13 +78,13 @@ public class MemoryViewUtil {
if (!(elem instanceof IAdaptable))
return false;
- IMemoryBlockRetrieval memRetrieval = (IMemoryBlockRetrieval) ((IAdaptable) elem).getAdapter(IMemoryBlockRetrieval.class);
+ IMemoryBlockRetrieval memRetrieval = ((IAdaptable) elem).getAdapter(IMemoryBlockRetrieval.class);
IDebugTarget debugTarget = null;
if (elem instanceof IDebugElement) {
debugTarget = ((IDebugElement) elem).getDebugTarget();
} else {
- debugTarget = (IDebugTarget) ((IAdaptable) elem).getAdapter(IDebugTarget.class);
+ debugTarget = ((IAdaptable) elem).getAdapter(IDebugTarget.class);
}
if (memRetrieval == null) {
@@ -197,7 +197,7 @@ public class MemoryViewUtil {
// check if the object can adapt to a memory block retrieval
if (object instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) object;
- retrieval = (IMemoryBlockRetrieval) adaptable.getAdapter(IMemoryBlockRetrieval.class);
+ retrieval = adaptable.getAdapter(IMemoryBlockRetrieval.class);
}
// if cannot adapt and the object itself is already an
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
index 6eaed8d30..89b298b34 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
@@ -93,7 +93,7 @@ public class RetargetAddMemoryBlockAction extends AddMemoryBlockAction {
if (standardMemRetrieval instanceof IAddMemoryBlocksTarget) {
target = (IAddMemoryBlocksTarget) standardMemRetrieval;
} else if (standardMemRetrieval instanceof IAdaptable) {
- target = (IAddMemoryBlocksTarget) ((IAdaptable) standardMemRetrieval).getAdapter(IAddMemoryBlocksTarget.class);
+ target = ((IAdaptable) standardMemRetrieval).getAdapter(IAddMemoryBlocksTarget.class);
}
return target;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
index 8a07ecf15..26cc15d23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
@@ -444,7 +444,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
* @return the decorated label for the specified <code>IMemoryBlock</code>
*/
private String decorateLabel(final IMemoryBlock memBlk, String label) {
- ILabelDecorator decorator = (ILabelDecorator) memBlk.getAdapter(ILabelDecorator.class);
+ ILabelDecorator decorator = memBlk.getAdapter(ILabelDecorator.class);
if (decorator != null) {
label = decorator.decorateText(label, memBlk);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
index 3d568e8c1..32ea601cb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 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
@@ -97,7 +97,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
private void notifyRendering(IModelDelta node, IModelProxy proxy) {
if (getTableViewer() != null)
{
- IModelChangedListener listener = (IModelChangedListener)getTableViewer().getRendering().getAdapter(IModelChangedListener.class);
+ IModelChangedListener listener = getTableViewer().getRendering().getAdapter(IModelChangedListener.class);
if (listener != null)
listener.modelChanged(node, proxy);
}
@@ -114,7 +114,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
{
if ((delta.getFlags() & IModelDelta.CONTENT) != 0)
{
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = rendering.getAdapter(TableRenderingContentDescriptor.class);
if (descriptor != null)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
index 3c5d3292c..7c3b7fc94 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
@@ -95,7 +95,7 @@ public class CopyTableRenderingToClipboardAction extends Action
IMemoryBlock memBlock = fRendering.getMemoryBlock();
if (memBlock instanceof IMemoryBlockExtension)
{
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)fRendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = fRendering.getAdapter(TableRenderingContentDescriptor.class);
if (descriptor == null)
{
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
index ed3705a13..d610df637 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
@@ -410,7 +410,7 @@ public class FormatTableRenderingDialog extends TrayDialog
private int getDefaultRowSize()
{
int size = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
if (elmt != null)
{
if (elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL))
@@ -425,7 +425,7 @@ public class FormatTableRenderingDialog extends TrayDialog
private int getDefaultColumnSize()
{
int size = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
if (elmt != null)
{
if (elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
@@ -465,7 +465,7 @@ public class FormatTableRenderingDialog extends TrayDialog
int columnSize = fColumnSizes[fColumnControl.getSelectionIndex()];
int rowSize = fRowSizes[fRowControl.getSelectionIndex()];
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
if (elmt != null && elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL)
&& elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
@@ -549,7 +549,7 @@ public class FormatTableRenderingDialog extends TrayDialog
private int getDefaultFromPersistableElement(String propertyId) {
int defaultValue = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ IPersistableDebugElement elmt = fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
if (elmt != null)
{
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
index 71ebac1d2..ef3f1e9a6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
@@ -113,7 +113,7 @@ public class PrintTableRenderingAction extends Action
charsPerByte = 4;
int addressSizeInBytes = 0;
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)fRendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = fRendering.getAdapter(TableRenderingContentDescriptor.class);
if (descriptor == null)
{
// special for address column
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
index 62bd36369..90182653e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 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
@@ -13,10 +13,12 @@ package org.eclipse.debug.internal.ui.views.memory.renderings;
import java.math.BigInteger;
import org.eclipse.core.runtime.PlatformObject;
+
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
+
import org.eclipse.debug.ui.memory.AbstractTableRendering;
import org.eclipse.debug.ui.memory.IMemoryRendering;
@@ -105,10 +107,11 @@ public class TableRenderingContentInput extends PlatformObject {
public void updateContentBaseAddress() throws DebugException {
IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if (memoryBlock instanceof IMemoryBlockExtension)
+ if (memoryBlock instanceof IMemoryBlockExtension) {
fMemoryBlockBaseAddress = ((IMemoryBlockExtension)memoryBlock).getBigBaseAddress();
- else
+ } else {
fMemoryBlockBaseAddress = BigInteger.valueOf(memoryBlock.getStartAddress());
+ }
}
/**
@@ -123,16 +126,18 @@ public class TableRenderingContentInput extends PlatformObject {
if(memoryBlock instanceof IMemoryBlockExtension)
{
BigInteger startAddress = ((IMemoryBlockExtension)memoryBlock).getMemoryBlockStartAddress();
- if (startAddress != null)
+ if (startAddress != null) {
fStartAddress = startAddress;
+ }
}
} catch (DebugException e) {
// default to 0 if we have trouble getting the start address
fStartAddress = BigInteger.valueOf(0);
}
- if (fStartAddress == null)
+ if (fStartAddress == null) {
fStartAddress = BigInteger.valueOf(0);
+ }
}
return fStartAddress;
}
@@ -150,8 +155,9 @@ public class TableRenderingContentInput extends PlatformObject {
BigInteger endAddress;
try {
endAddress = ((IMemoryBlockExtension)memoryBlock).getMemoryBlockEndAddress();
- if (endAddress != null)
+ if (endAddress != null) {
fEndAddress = endAddress;
+ }
} catch (DebugException e) {
fEndAddress = null;
}
@@ -172,8 +178,9 @@ public class TableRenderingContentInput extends PlatformObject {
}
}
- if (fEndAddress == null)
+ if (fEndAddress == null) {
fEndAddress = BigInteger.valueOf(Integer.MAX_VALUE);
+ }
}
return fEndAddress;
}
@@ -188,17 +195,20 @@ public class TableRenderingContentInput extends PlatformObject {
fNumLines = numLines;
}
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
if (adapter == AbstractTableRendering.class)
{
- if (fRendering instanceof AbstractTableRendering)
- return fRendering;
+ if (fRendering instanceof AbstractTableRendering) {
+ return (T) fRendering;
+ }
}
if (adapter == AbstractAsyncTableRendering.class)
{
- if (fRendering instanceof AbstractAsyncTableRendering)
- return fRendering;
+ if (fRendering instanceof AbstractAsyncTableRendering) {
+ return (T) fRendering;
+ }
}
return super.getAdapter(adapter);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
index 51d14a938..5848db937 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 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
@@ -94,10 +94,11 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
if (newInput instanceof TableRenderingContentInput)
{
fInput = (TableRenderingContentInput)newInput;
- if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension)
+ if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension) {
loadContentForExtendedMemoryBlock();
- else
+ } else {
loadContentForSimpleMemoryBlock();
+ }
// tell rendering to display table if the loading is successful
getTableRendering(fInput).displayTable();
@@ -131,8 +132,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
}
}
- if (lineCache.isEmpty())
+ if (lineCache.isEmpty()) {
return lineCache.toArray();
+ }
// check to see if the row size has changed
TableRenderingLine line = lineCache.get(0);
@@ -187,8 +189,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
public void loadContentForExtendedMemoryBlock() throws DebugException {
// do not load if number of lines needed is < 0
- if (fInput.getNumLines() <= 0)
+ if (fInput.getNumLines() <= 0) {
return;
+ }
// calculate top buffered address
BigInteger loadAddress = fInput.getLoadAddress();
@@ -221,8 +224,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
if (isDynamicLoad())
{
- if (bufferStart.compareTo(mbStart) < 0)
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
+ }
if (bufferEnd.compareTo(mbEnd) > 0)
{
@@ -238,13 +242,15 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
// if after adjusting buffer start, it goes before the memory block start
// address, adjust it back
- if (bufferStart.compareTo(mbStart) < 0)
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
+ }
}
// buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
+ if (bufferEnd.compareTo(bufferStart) <= 0) {
throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null));
+ }
int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
// get stoarage to fit the memory view tab size
@@ -252,8 +258,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
}
else
{
- if (bufferStart.compareTo(mbStart) < 0)
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
+ }
if (bufferEnd.compareTo(mbEnd) > 0)
{
@@ -261,19 +268,22 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
bufferEnd = mbEnd;
// after adjusting buffer start, check if it's smaller than memory block's start address
- if (bufferStart.compareTo(mbStart) < 0)
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
+ }
}
// buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
+ if (bufferEnd.compareTo(bufferStart) <= 0) {
throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null));
+ }
int numLines = fInput.getNumLines();
int bufferNumLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
- if (bufferNumLines < numLines)
+ if (bufferNumLines < numLines) {
numLines = bufferNumLines;
+ }
// get stoarage to fit the memory view tab size
getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta());
@@ -300,8 +310,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
// is already terminated
IDebugTarget target = fInput.getMemoryBlock().getDebugTarget();
- if (target.isDisconnected() || target.isTerminated())
+ if (target.isDisconnected() || target.isTerminated()) {
return;
+ }
DebugException dbgEvt = null;
@@ -544,10 +555,11 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
if (manageDelta)
{
- if (oldLine != null)
+ if (oldLine != null) {
newLine.isMonitored = true;
- else
+ } else {
newLine.isMonitored = false;
+ }
}
else
{
@@ -631,17 +643,20 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
// only do this if it's visible
// still need to clear content cache if the rendering
// is not visible
- if (isUpdateManagedByMB())
+ if (isUpdateManagedByMB()) {
return;
+ }
}
// do nothing if the debug event did not come from a debug element comes from non-debug element
- if (!(event.getSource() instanceof IDebugElement))
+ if (!(event.getSource() instanceof IDebugElement)) {
return;
+ }
// do not try to recover if the content input has not been created
- if (fInput == null)
+ if (fInput == null) {
return;
+ }
IDebugElement src = (IDebugElement)event.getSource();
@@ -686,8 +701,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
takeContentSnapshot();
//do not handle event if the rendering is not visible
- if (!getTableRendering(fInput).isVisible())
- return;
+ if (!getTableRendering(fInput).isVisible()) {
+ return;
+ }
getTableRendering(fInput).refresh();
@@ -709,8 +725,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
}
//do not handle event if the rendering is not visible
- if (!getTableRendering(fInput).isVisible())
- return;
+ if (!getTableRendering(fInput).isVisible()) {
+ return;
+ }
// use existing lines as cache is the rendering is not currently displaying
// error. Otherwise, leave contentCache empty as we do not have updated
@@ -809,8 +826,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
TableRenderingLine first = lineCache.firstElement();
TableRenderingLine last = lineCache.lastElement();
- if (first == null ||last == null)
+ if (first == null ||last == null) {
return true;
+ }
BigInteger startAddress = new BigInteger(first.getAddress(), 16);
BigInteger lastAddress = new BigInteger(last.getAddress(), 16);
@@ -847,13 +865,15 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
managedMB = (IMemoryRenderingUpdater)memoryBlock;
}
- if (managedMB == null)
- managedMB = (IMemoryRenderingUpdater)memoryBlock.getAdapter(IMemoryRenderingUpdater.class);
+ if (managedMB == null) {
+ managedMB = memoryBlock.getAdapter(IMemoryRenderingUpdater.class);
+ }
// do not handle event if if the memory block wants to do its
// own update
- if (managedMB != null && managedMB.supportsManagedUpdate(getTableRendering(fInput)))
+ if (managedMB != null && managedMB.supportsManagedUpdate(getTableRendering(fInput))) {
return true;
+ }
return false;
}
@@ -875,8 +895,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
private void reorganizeLines(Vector<TableRenderingLine> lines, int numBytesPerLine) throws DebugException
{
- if (lines == null || lines.isEmpty())
+ if (lines == null || lines.isEmpty()) {
return;
+ }
Object[] objs = lines.toArray();
@@ -912,8 +933,9 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
{
// if content cache is empty, do nothing
if (contentCache == null || contentCache.isEmpty()
- || fContentCacheInBytes.length == 0 || fContentCacheStartAddress == null)
+ || fContentCacheInBytes.length == 0 || fContentCacheStartAddress == null) {
return;
+ }
MemoryByte[] bytes = fContentCacheInBytes;
TableRenderingLine[] convertedLines = convertBytesToLines(bytes, bytesPerLine, new BigInteger(fContentCacheStartAddress, 16));
@@ -984,6 +1006,6 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
private AbstractTableRendering getTableRendering(TableRenderingContentInput input)
{
- return (AbstractTableRendering)input.getAdapter(AbstractTableRendering.class);
+ return input.getAdapter(AbstractTableRendering.class);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
index 5623ba8ef..3718c163c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 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
@@ -35,7 +35,7 @@ public class TableRenderingLabelProvider extends AbstractTableRenderingLabelProv
public TableRenderingLabelProvider(AbstractTableRendering rendering){
super(rendering);
- fTablePresentation = (IMemoryBlockTablePresentation)rendering.getAdapter(IMemoryBlockTablePresentation.class);
+ fTablePresentation = rendering.getAdapter(IMemoryBlockTablePresentation.class);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
index 40f059d7b..c3ab9d8e3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -39,9 +39,9 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i
public TableRenderingLabelProviderEx(AbstractTableRendering rendering) {
super(rendering);
- fLabelProvider = (ILabelProvider) rendering.getAdapter(ILabelProvider.class);
- fColorProvider = (IColorProvider) rendering.getAdapter(IColorProvider.class);
- fFontProvider = (IFontProvider) rendering.getAdapter(IFontProvider.class);
+ fLabelProvider = rendering.getAdapter(ILabelProvider.class);
+ fColorProvider = rendering.getAdapter(IColorProvider.class);
+ fFontProvider = rendering.getAdapter(IFontProvider.class);
}
/*
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
index 6cf038350..998e8e508 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.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
@@ -264,7 +264,7 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
clearCache();
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) rendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = rendering.getAdapter(TableRenderingContentDescriptor.class);
boolean alignAddress = true;
if (descriptor != null && !descriptor.isAlignAddressToBoundary()) {
alignAddress = descriptor.isAlignAddressToBoundary();
@@ -301,7 +301,7 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel implem
int addressableSize = rendering.getAddressableSize();
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) rendering.getAdapter(TableRenderingContentDescriptor.class);
+ TableRenderingContentDescriptor descriptor = rendering.getAdapter(TableRenderingContentDescriptor.class);
boolean alignAddress = true;
if (descriptor != null && !descriptor.isAlignAddressToBoundary()) {
alignAddress = descriptor.isAlignAddressToBoundary();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
index ae7f4c411..578910e77 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
@@ -131,7 +131,7 @@ public class ModulesView extends VariablesView {
if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context;
if (adaptable.getAdapter(IHelpContextIdProvider.class) != null) {
- IHelpContextIdProvider provider = (IHelpContextIdProvider) adaptable
+ IHelpContextIdProvider provider = adaptable
.getAdapter(IHelpContextIdProvider.class);
String helpId = provider.getHelpContextId(IDebugHelpContextIds.MODULES_VIEW);
if (helpId != null) {
@@ -164,7 +164,7 @@ public class ModulesView extends VariablesView {
if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context;
if (adaptable.getAdapter(ILabelProvider.class) != null) {
- ILabelProvider provider = (ILabelProvider) adaptable
+ ILabelProvider provider = adaptable
.getAdapter(ILabelProvider.class);
String label = provider.getText(this);
if (label != null)
@@ -179,7 +179,7 @@ public class ModulesView extends VariablesView {
if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context;
if (adaptable.getAdapter(ILabelProvider.class) != null) {
- ILabelProvider provider = (ILabelProvider) adaptable
+ ILabelProvider provider = adaptable
.getAdapter(ILabelProvider.class);
Image image = provider.getImage(this);
if (image != null)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
index 33a0952fb..67be772b6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 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
@@ -128,7 +128,7 @@ public class IndexedValuePartition implements IIndexedValue {
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
return fValue.getAdapter(adapter);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
index 93ec5fd68..4b9cd843e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
@@ -123,7 +123,7 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I
}
protected StructuredViewer getStructuredViewer() {
- IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class);
+ IDebugView view = getView().getAdapter(IDebugView.class);
if (view != null) {
Viewer viewer = view.getViewer();
if (viewer instanceof StructuredViewer) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index 4e295beb6..1e43e7e4a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -1516,7 +1516,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
public synchronized void viewerUpdatesBegin() {
fTriggerDetailsJob.cancel();
IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
+ getSite().getAdapter(IWorkbenchSiteProgressService.class);
if (progressService != null) {
progressService.incrementBusy();
}
@@ -1531,7 +1531,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
fTriggerDetailsJob.schedule();
}
IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
+ getSite().getAdapter(IWorkbenchSiteProgressService.class);
if (progressService != null) {
progressService.decrementBusy();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
index 51e753bb3..823db6fdd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.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
@@ -17,13 +17,16 @@ import java.util.Iterator;
import java.util.ResourceBundle;
import org.eclipse.core.commands.operations.IUndoContext;
+
import org.eclipse.core.resources.IMarker;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugElement;
@@ -42,11 +45,13 @@ import org.eclipse.debug.internal.ui.actions.variables.details.DetailPaneWordWra
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer;
import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
import org.eclipse.debug.internal.ui.views.variables.IndexedValuePartition;
+
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.IDebugView;
import org.eclipse.debug.ui.IDetailPane2;
import org.eclipse.debug.ui.IValueDetailListener;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -56,6 +61,7 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.StatusLineContributionItem;
import org.eclipse.jface.commands.ActionHandler;
import org.eclipse.jface.resource.JFaceResources;
+
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.DocumentEvent;
@@ -69,12 +75,14 @@ import org.eclipse.jface.text.IUndoManagerExtension;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
+
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
@@ -90,6 +98,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
+
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.PlatformUI;
@@ -102,6 +111,7 @@ import org.eclipse.ui.operations.OperationHistoryActionHandler;
import org.eclipse.ui.operations.RedoActionHandler;
import org.eclipse.ui.operations.UndoActionHandler;
import org.eclipse.ui.progress.WorkbenchJob;
+
import org.eclipse.ui.texteditor.FindReplaceAction;
import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
@@ -212,7 +222,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
IBreakpointContainer c = (IBreakpointContainer) element;
IAdaptable category = c.getCategory();
if (category != null) {
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) category.getAdapter(IWorkbenchAdapter.class);
+ IWorkbenchAdapter adapter = category.getAdapter(IWorkbenchAdapter.class);
if (adapter != null) {
message = adapter.getLabel(category);
} else {
@@ -739,13 +749,14 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Class required) {
+ public <T> T getAdapter(Class<T> required) {
if (IFindReplaceTarget.class.equals(required)) {
- return fSourceViewer.getFindReplaceTarget();
+ return (T) fSourceViewer.getFindReplaceTarget();
}
if (ITextViewer.class.equals(required)) {
- return fSourceViewer;
+ return (T) fSourceViewer;
}
return null;
}
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()) {
diff --git a/org.eclipse.ui.console/META-INF/MANIFEST.MF b/org.eclipse.ui.console/META-INF/MANIFEST.MF
index 1f9633d9f..a92c8d5ff 100644
--- a/org.eclipse.ui.console/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.console/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Export-Package: org.eclipse.ui.console,
Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.variables;bundle-version="[3.2.800,4.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
index 67e90d4e7..78634dd0c 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.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
@@ -18,6 +18,7 @@ import java.util.Map;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.IAdaptable;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -25,19 +26,23 @@ import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.JFaceResources;
+
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IFindReplaceTarget;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.text.TextEvent;
+
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Widget;
+
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -52,6 +57,7 @@ import org.eclipse.ui.internal.console.FollowHyperlinkAction;
import org.eclipse.ui.internal.console.IConsoleHelpContextIds;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.IPageSite;
+
import org.eclipse.ui.texteditor.FindReplaceAction;
import org.eclipse.ui.texteditor.IUpdate;
@@ -327,13 +333,14 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- @Override
- public Object getAdapter(Class required) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> required) {
if (IFindReplaceTarget.class.equals(required)) {
- return fViewer.getFindReplaceTarget();
+ return (T) fViewer.getFindReplaceTarget();
}
if (Widget.class.equals(required)) {
- return fViewer.getTextWidget();
+ return (T) fViewer.getTextWidget();
}
return null;
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
index adf1d429c..fdfc65b4f 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.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,6 +19,7 @@ import java.util.Map;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
+
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
@@ -28,6 +29,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
+
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
@@ -37,6 +39,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
+
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IViewSite;
@@ -615,14 +618,15 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
public void warnOfContentChange(IConsole console) {
IWorkbenchPart part = fConsoleToPart.get(console);
if (part != null) {
- IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) part.getSite().getAdapter(IWorkbenchSiteProgressService.class);
+ IWorkbenchSiteProgressService service = part.getSite().getAdapter(IWorkbenchSiteProgressService.class);
if (service != null) {
service.warnOfContentChange();
}
}
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public Object getAdapter(Class key) {
Object adpater = super.getAdapter(key);
if (adpater == null) {
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java
index 5a9acda45..400f7d528 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.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
@@ -122,7 +122,7 @@ public class ConsoleWorkbenchPart 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;
}

Back to the top