Source:
private synchronized int findNumFrames() { int frameNum = 0; if (DsfSession.getSession(fSessionId) == null) { return 0; } final DsfExecutor executor = DsfSession.getSession(fSessionId) .getExecutor(); final DsfServicesTracker tracker = new DsfServicesTracker( GdbTraceCorePlugin.getBundleContext(), fSessionId); Query<ITraceStatusDMData> selectRecordQuery = new Query<ITraceStatusDMData>() { @Override public void execute( final DataRequestMonitor<ITraceStatusDMData> queryRm) { final IGDBTraceControl traceControl = tracker .getService(IGDBTraceControl.class); final ICommandControlService commandControl = checkNotNull(tracker.getService(ICommandControlService.class)); final ITraceTargetDMContext dmc = (ITraceTargetDMContext) commandControl .getContext(); if (traceControl != null) { traceControl.getTraceStatus(dmc, queryRm); } else { queryRm.done(); } } }; try { executor.execute(selectRecordQuery); ITraceStatusDMData data; if (fIsTimeoutEnabled) { data = selectRecordQuery.get(fTimeout, TimeUnit.MILLISECONDS); } else { data = selectRecordQuery.get(); } frameNum = data.getNumberOfCollectedFrame(); } catch (InterruptedException e) { GdbTraceCorePlugin.logError(INTERRUPTION_EXCEPTION, e); } catch (ExecutionException e) { GdbTraceCorePlugin.logError(GDB_EXCEPTION, e); } catch (RejectedExecutionException e) { GdbTraceCorePlugin.logError(REQUEST_REJECTED_EXCEPTION, e); } catch (TimeoutException e) { GdbTraceCorePlugin.logError(TIMEOUT, e); } finally { tracker.dispose(); } return frameNum; }

Target:
private synchronized int findNumFrames() { int frameNum = 0; if (DsfSession.getSession(fSessionId) == null) { return 0; } final DsfExecutor executor = DsfSession.getSession(fSessionId) .getExecutor(); final DsfServicesTracker tracker = new DsfServicesTracker( GdbTraceCorePlugin.getBundleContext(), fSessionId); Query<ITraceStatusDMData> selectRecordQuery = new Query<ITraceStatusDMData>() { @Override public void execute( final DataRequestMonitor<ITraceStatusDMData> queryRm) { final IGDBTraceControl traceControl = tracker .getService(IGDBTraceControl.class); final ICommandControlService commandControl = tracker.getService(ICommandControlService.class); if (commandControl == null) { queryRm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Could not find necessary services", null)); queryRm.done(); return; } final ITraceTargetDMContext dmc = (ITraceTargetDMContext) commandControl .getContext(); if (traceControl != null) { traceControl.getTraceStatus(dmc, queryRm); } else { queryRm.done(); } } }; try { executor.execute(selectRecordQuery); ITraceStatusDMData data; if (fIsTimeoutEnabled) { data = selectRecordQuery.get(fTimeout, TimeUnit.MILLISECONDS); } else { data = selectRecordQuery.get(); } frameNum = data.getNumberOfCollectedFrame(); } catch (InterruptedException e) { GdbTraceCorePlugin.logError(INTERRUPTION_EXCEPTION, e); } catch (ExecutionException e) { GdbTraceCorePlugin.logError(GDB_EXCEPTION, e); } catch (RejectedExecutionException e) { GdbTraceCorePlugin.logError(REQUEST_REJECTED_EXCEPTION, e); } catch (TimeoutException e) { GdbTraceCorePlugin.logError(TIMEOUT, e); } finally { tracker.dispose(); } return frameNum; }