Source:
<code>public void buildIndex(final long offset, final TmfTimeRange range, final boolean waitForCompletion) { synchronized (fTraceIndex) { if (fIsIndexing) { return; } fIsIndexing = true; } final Job job = new Job("Indexing " + fTrace.getName() + "...") { @Override protected IStatus run(final IProgressMonitor monitor) { monitor.beginTask("", IProgressMonitor.UNKNOWN); while (!monitor.isCanceled()) { try { Thread.sleep(100); <START> setName("Indexing " + fTrace.getName() + " (" + fTrace.getNbEvents() + ")"); END> monitor.setTaskName(""); } catch (final InterruptedException e) { return Status.OK_STATUS; } } monitor.done(); return Status.OK_STATUS; } }; job.schedule(); fIndexingRequest = new TmfEventRequest(ITmfEvent.class, range, offset, TmfDataRequest.ALL_DATA, fCheckpointInterval, ITmfDataRequest.ExecutionType.BACKGROUND) { @Override public void handleData(final ITmfEvent event) { super.handleData(event); if (event != null) { if ((getNbRead() % fCheckpointInterval) == 0) { updateTraceStatus(); } } } @Override public void handleSuccess() { updateTraceStatus(); } @Override public void handleCompleted() { job.cancel(); super.handleCompleted(); fIsIndexing = false; } private void updateTraceStatus() { if (fTrace.getNbEvents() > 0) { signalNewTimeRange(fTrace.getStartTime(), fTrace.getEndTime()); } } }; fTrace.sendRequest(fIndexingRequest); if (waitForCompletion) { try { fIndexingRequest.waitForCompletion(); } catch (final InterruptedException e) { } } }</code><technical_language>super pedantic, "Indexing" NON-NLS. a translatable string, stored in a messages.properties file</technical_language>

Target:
public void buildIndex(final long offset, final TmfTimeRange range, final boolean waitForCompletion) { synchronized (fTraceIndex) { if (fIsIndexing) { return; } fIsIndexing = true; } final Job job = new Job("Indexing " + fTrace.getName() + "...") { @Override protected IStatus run(final IProgressMonitor monitor) { monitor.beginTask("", IProgressMonitor.UNKNOWN); while (!monitor.isCanceled()) { try { long prevNbEvents = fTrace.getNbEvents(); Thread.sleep(250); long nbEvents = fTrace.getNbEvents(); setName(Messages.TmfCheckpointIndexer_Indexing + fTrace.getName() + " (" + nbEvents + ")"); long rate = (nbEvents - prevNbEvents) * 4; monitor.setTaskName(rate + Messages.TmfCheckpointIndexer_EventsPerSecond); } catch (final InterruptedException e) { return Status.OK_STATUS; } } monitor.done(); return Status.OK_STATUS; } }; job.schedule(); fIndexingRequest = new TmfEventRequest(ITmfEvent.class, range, offset, TmfDataRequest.ALL_DATA, fCheckpointInterval, ITmfDataRequest.ExecutionType.BACKGROUND) { @Override public void handleData(final ITmfEvent event) { super.handleData(event); if (event != null) { if ((getNbRead() % fCheckpointInterval) == 0) { updateTraceStatus(); } } } @Override public void handleSuccess() { updateTraceStatus(); } @Override public void handleCompleted() { job.cancel(); super.handleCompleted(); fIsIndexing = false; } private void updateTraceStatus() { if (fTrace.getNbEvents() > 0) { signalNewTimeRange(fTrace.getStartTime(), fTrace.getEndTime()); } } }; fTrace.sendRequest(fIndexingRequest); if (waitForCompletion) { try { fIndexingRequest.waitForCompletion(); } catch (final InterruptedException e) { } } }