Source:
protected void updateContent(long start, long end, boolean isSelection) { try (FlowScopeLog scope = new FlowScopeLogBuilder(LOGGER, Level.FINE, UPDATE_CONTENT_JOB_NAME) .setCategory("TreeViewer").build()) { Job thread = new Job(UPDATE_CONTENT_JOB_NAME) { @Override public IStatus run(IProgressMonitor monitor) { try (FlowScopeLog runScope = new FlowScopeLogBuilder(LOGGER, Level.FINE, UPDATE_CONTENT_JOB_NAME + " run") .setParentScope(scope).build()) { ITmfTreeDataProvider<@NonNull TmfTreeDataModel> provider = getProvider(); if (provider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return Status.OK_STATUS; } TimeQueryFilter filter = getFilter(start, end, isSelection); if (filter == null) { return Status.OK_STATUS; } boolean isComplete = false; do { TmfModelResponse<@NonNull List<@NonNull TmfTreeDataModel>> response; try (FlowScopeLog iterScope = new FlowScopeLogBuilder(LOGGER, Level.FINE, UPDATE_CONTENT_JOB_NAME + " query") .setParentScope(scope).build()) { response = provider.fetchTree(filter, monitor); List<@NonNull TmfTreeDataModel> model = response.getModel(); if (model != null) { updateTree(start, end, model); } } ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { runScope.addData(FAILED_TO_SLEEP_PREFIX + getName(), e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, FAILED_TO_SLEEP_PREFIX + getName()); } } } while (!isComplete); return Status.OK_STATUS; } } }; thread.setSystem(true); thread.schedule(); } }

Target:
protected void updateContent(long start, long end, boolean isSelection) { try (FlowScopeLog scope = new FlowScopeLogBuilder(LOGGER, Level.FINE, UPDATE_CONTENT_JOB_NAME) .setCategory("TreeViewer").build()) { Job thread = new Job(UPDATE_CONTENT_JOB_NAME) { @Override public IStatus run(IProgressMonitor monitor) { try (FlowScopeLog runScope = new FlowScopeLogBuilder(LOGGER, Level.FINE, UPDATE_CONTENT_JOB_NAME + " run") .setParentScope(scope).build()) { ITmfTreeDataProvider<@NonNull TmfTreeDataModel> provider = getProvider(); if (provider == null) { Activator.getDefault().logInfo("Trace: " + getTrace().getName() + " does not have a data provider for ID: " + fId); return Status.OK_STATUS; } TimeQueryFilter filter = getFilter(start, end, isSelection); if (filter == null) { return Status.OK_STATUS; } boolean isComplete = false; do { TmfModelResponse<@NonNull List<@NonNull TmfTreeDataModel>> response; try (FlowScopeLog iterScope = new FlowScopeLogBuilder(LOGGER, Level.FINE, UPDATE_CONTENT_JOB_NAME + " query") .setParentScope(scope).build()) { response = provider.fetchTree(filter, monitor); List<@NonNull TmfTreeDataModel> model = response.getModel(); if (model != null) { updateTree(start, end, model); } } ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { runScope.addData(FAILED_TO_SLEEP_PREFIX + getName(), e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, FAILED_TO_SLEEP_PREFIX + getName()); } } } while (!isComplete); return Status.OK_STATUS; } } }; thread.setSystem(true); thread.schedule(); } }