1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-04 06:03:18 +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 @Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) { protected void updateElementsInSessionThread(final IChildrenUpdate update) {
IStack stackService = getServicesTracker().getService(IStack.class);
if ( getServicesTracker().getService(IStack.class) == null ) {
handleFailedUpdate(update);
return;
}
final IExecutionDMContext execDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IExecutionDMContext.class); final IExecutionDMContext execDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IExecutionDMContext.class);
if (execDmc == null) { if (stackService == null || execDmc == null) {
handleFailedUpdate(update); handleFailedUpdate(update);
return; return;
} }
getServicesTracker().getService(IStack.class).getFrames( stackService.getFrames(
execDmc, execDmc,
new ViewerDataRequestMonitor<IFrameDMContext[]>(getSession().getExecutor(), update) { new ViewerDataRequestMonitor<IFrameDMContext[]>(getSession().getExecutor(), update) {
@Override @Override
@ -142,12 +137,13 @@ public class StackFramesVMNode extends AbstractDMVMNode
try { try {
getSession().getExecutor().execute(new DsfRunnable() { getSession().getExecutor().execute(new DsfRunnable() {
public void run() { public void run() {
if ( getServicesTracker().getService(IStack.class) == null ) { IStack stackService = getServicesTracker().getService(IStack.class);
if ( stackService == null ) {
handleFailedUpdate(update); handleFailedUpdate(update);
return; return;
} }
getServicesTracker().getService(IStack.class).getTopFrame( stackService.getTopFrame(
execDmc, execDmc,
new ViewerDataRequestMonitor<IFrameDMContext>(getExecutor(), update) { new ViewerDataRequestMonitor<IFrameDMContext>(getExecutor(), update) {
@Override @Override
@ -198,17 +194,13 @@ public class StackFramesVMNode extends AbstractDMVMNode
protected void updateLabelInSessionThread(ILabelUpdate[] updates) { protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
for (final ILabelUpdate update : updates) { for (final ILabelUpdate update : updates) {
IStack stackService = getServicesTracker().getService(IStack.class);
final IFrameDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IFrameDMContext.class); final IFrameDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IFrameDMContext.class);
if ( dmc == null ) { if (stackService == null || dmc == null) {
handleFailedUpdate(update); handleFailedUpdate(update);
continue; continue;
} }
if ( getServicesTracker().getService(IStack.class) == null ) {
handleFailedUpdate(update);
continue;
}
getDMVMProvider().getModelData( getDMVMProvider().getModelData(
this, update, this, update,

View file

@ -55,31 +55,25 @@ public class ModulesVMNode extends AbstractDMVMNode
@Override @Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) { protected void updateElementsInSessionThread(final IChildrenUpdate update) {
IModules modulesService = getServicesTracker().getService(IModules.class);
if ( getServicesTracker().getService(IModules.class) == null ) {
handleFailedUpdate(update);
return;
}
final ISymbolDMContext symDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), ISymbolDMContext.class) ; final ISymbolDMContext symDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), ISymbolDMContext.class) ;
if (symDmc != null) { if (modulesService == null || 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 {
handleFailedUpdate(update); 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 @Override
@ -103,21 +97,18 @@ public class ModulesVMNode extends AbstractDMVMNode
protected void updateLabelInSessionThread(ILabelUpdate[] updates) { protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
for (final ILabelUpdate update : updates) { for (final ILabelUpdate update : updates) {
IModules modulesService = getServicesTracker().getService(IModules.class);
final IModuleDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IModuleDMContext.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 either update or service are not valid, fail the update and exit.
if ( dmc == null ) { if ( modulesService == null || dmc == null ) {
handleFailedUpdate(update); handleFailedUpdate(update);
continue; 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. // 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); update.setImageDescriptor(DsfDebugUIPlugin.getImageDescriptor(IDsfDebugUIConstants.IMG_OBJS_SHARED_LIBRARY_SYMBOLS_LOADED), 0);
getServicesTracker().getService(IModules.class, null).getModuleData( modulesService.getModuleData(
dmc, dmc,
new ViewerDataRequestMonitor<IModuleDMData>(getSession().getExecutor(), update) { new ViewerDataRequestMonitor<IModuleDMData>(getSession().getExecutor(), update) {
@Override @Override

View file

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