1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-01 04:33:36 +02:00

[221899] Additional cleanup after removing checkService().

This commit is contained in:
Pawel Piech 2008-05-12 22:41:47 +00:00
parent 1de4e83823
commit 25f8027f2c
3 changed files with 27 additions and 49 deletions

View file

@ -85,19 +85,14 @@ public class StackFramesVMNode extends AbstractDMVMNode
*/
@Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
if ( getServicesTracker().getService(IStack.class) == null ) {
handleFailedUpdate(update);
return;
}
IStack stackService = getServicesTracker().getService(IStack.class);
final IExecutionDMContext execDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IExecutionDMContext.class);
if (execDmc == null) {
if (stackService == null || execDmc == null) {
handleFailedUpdate(update);
return;
}
getServicesTracker().getService(IStack.class).getFrames(
stackService.getFrames(
execDmc,
new ViewerDataRequestMonitor<IFrameDMContext[]>(getSession().getExecutor(), update) {
@Override
@ -142,12 +137,13 @@ public class StackFramesVMNode extends AbstractDMVMNode
try {
getSession().getExecutor().execute(new DsfRunnable() {
public void run() {
if ( getServicesTracker().getService(IStack.class) == null ) {
IStack stackService = getServicesTracker().getService(IStack.class);
if ( stackService == null ) {
handleFailedUpdate(update);
return;
}
getServicesTracker().getService(IStack.class).getTopFrame(
stackService.getTopFrame(
execDmc,
new ViewerDataRequestMonitor<IFrameDMContext>(getExecutor(), update) {
@Override
@ -198,17 +194,13 @@ public class StackFramesVMNode extends AbstractDMVMNode
protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
for (final ILabelUpdate update : updates) {
IStack stackService = getServicesTracker().getService(IStack.class);
final IFrameDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IFrameDMContext.class);
if ( dmc == null ) {
if (stackService == null || dmc == null) {
handleFailedUpdate(update);
continue;
}
if ( getServicesTracker().getService(IStack.class) == null ) {
handleFailedUpdate(update);
continue;
}
getDMVMProvider().getModelData(
this, update,

View file

@ -55,31 +55,25 @@ public class ModulesVMNode extends AbstractDMVMNode
@Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
if ( getServicesTracker().getService(IModules.class) == null ) {
handleFailedUpdate(update);
return;
}
IModules modulesService = getServicesTracker().getService(IModules.class);
final ISymbolDMContext symDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), ISymbolDMContext.class) ;
if (symDmc != null) {
getServicesTracker().getService(IModules.class).getModules(
symDmc,
new ViewerDataRequestMonitor<IModuleDMContext[]>(getSession().getExecutor(), update) {
@Override
public void handleCompleted() {
if (!isSuccess()) {
update.done();
return;
}
fillUpdateWithVMCs(update, getData());
update.done();
}});
} else {
if (modulesService == null || symDmc == null) {
handleFailedUpdate(update);
}
}
modulesService.getModules(
symDmc,
new ViewerDataRequestMonitor<IModuleDMContext[]>(getSession().getExecutor(), update) {
@Override
public void handleCompleted() {
if (!isSuccess()) {
update.done();
return;
}
fillUpdateWithVMCs(update, getData());
update.done();
}});
}
@Override
@ -103,21 +97,18 @@ public class ModulesVMNode extends AbstractDMVMNode
protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
for (final ILabelUpdate update : updates) {
IModules modulesService = getServicesTracker().getService(IModules.class);
final IModuleDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IModuleDMContext.class);
// If either update or service are not valid, fail the update and exit.
if ( dmc == null ) {
if ( modulesService == null || dmc == null ) {
handleFailedUpdate(update);
continue;
}
if ( getServicesTracker().getService(IModules.class) == null ) {
handleFailedUpdate(update);
continue;
}
// Use different image for loaded and unloaded symbols when event to report loading of symbols is implemented.
update.setImageDescriptor(DsfDebugUIPlugin.getImageDescriptor(IDsfDebugUIConstants.IMG_OBJS_SHARED_LIBRARY_SYMBOLS_LOADED), 0);
getServicesTracker().getService(IModules.class, null).getModuleData(
modulesService.getModuleData(
dmc,
new ViewerDataRequestMonitor<IModuleDMData>(getSession().getExecutor(), update) {
@Override

View file

@ -68,13 +68,8 @@ public class ThreadVMNode extends AbstractDMVMNode
@Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
IRunControl runControl = getServicesTracker().getService(IRunControl.class);
if ( runControl == null ) {
handleFailedUpdate(update);
return;
}
final IContainerDMContext contDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IContainerDMContext.class);
if (contDmc == null) {
if (runControl == null || contDmc == null) {
handleFailedUpdate(update);
return;
}