Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2015-02-20 12:08:00 +0000
committerDani Megert2015-02-20 12:08:00 +0000
commit035b16c4845dde58ab3f6463878cbe662349e58c (patch)
treea312725ef6ac6c4aeedc3ca81bad03b0583f5fb1 /org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters
parent87bf3db976790862ceb9b321661e0234afb342ca (diff)
downloadeclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.tar.gz
eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.tar.xz
eclipse.platform.debug-035b16c4845dde58ab3f6463878cbe662349e58c.zip
Fixed bug 460417: Fix compiler problems from generified IAdaptable#getAdapter(..)
Diffstat (limited to 'org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters')
-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
2 files changed, 19 insertions, 15 deletions
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};
}

Back to the top