1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Move to new getAdapter() signature using generics

Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Marc Khouzam 2015-04-15 13:35:39 -04:00
parent 39fa80d9de
commit 7c8b2459d5
5 changed files with 12 additions and 16 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2014 Ericsson and others.
* Copyright (c) 2008, 2015 Ericsson 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
@ -58,8 +58,7 @@ public class TestMIBreakInsertCommand {
}
@Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
public <T> T getAdapter(Class<T> adapter) {
return null;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2014 Ericsson and others.
* Copyright (c) 2008, 2015 Ericsson 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
@ -70,8 +70,7 @@ public class TestMICommandConstructCommand {
}
@Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
public <T> T getAdapter(Class<T> adapter) {
return null;
}
}

View file

@ -98,9 +98,8 @@ public class ConsolePageParticipant implements IConsolePageParticipant, IDebugCo
return false;
}
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
public <T> T getAdapter(Class<T> adapter) {
return null;
}

View file

@ -127,9 +127,8 @@ public class GDBPatternMatchingExpressions extends AbstractDsfService implements
return fExprDelegate.getParents();
};
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapterType) {
public <T> T getAdapter(Class<T> adapterType) {
return fExprDelegate.getAdapter(adapterType);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Ericsson and others.
* Copyright (c) 2008, 2015 Ericsson 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,17 +35,17 @@ public class BreakpointActionAdapter implements IAdaptable {
fContext = context;
}
@SuppressWarnings("rawtypes")
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
public <T> T getAdapter(Class<T> adapter) {
if (adapter.equals(ILogActionEnabler.class)) {
return new MILogActionEnabler(fExecutor, fServiceTracker, fContext);
return (T)new MILogActionEnabler(fExecutor, fServiceTracker, fContext);
}
if (adapter.equals(IResumeActionEnabler.class)) {
return new MIResumeActionEnabler(fExecutor, fServiceTracker, fContext);
return (T)new MIResumeActionEnabler(fExecutor, fServiceTracker, fContext);
}
if (adapter.equals(IReverseDebugEnabler.class)) {
return new MIReverseDebugEnabler(fExecutor, fServiceTracker, fContext);
return (T)new MIReverseDebugEnabler(fExecutor, fServiceTracker, fContext);
}
return null;
}