Program: 92160
Project: 92160
Buggy source:
@Override public void buildIndex(final long offset,final TmfTimeRange range,final boolean waitForCompletion){
synchronized (fTraceIndex) {
    if (fIsIndexing) {
      return;
    }
    fIsIndexing=true;
  }
  final Job job=new Job("String_Node_Str" + fTrace.getName() + "String_Node_Str"){
    @Override protected IStatus run(    final IProgressMonitor monitor){
      while (!monitor.isCanceled()) {
        try {
          Thread.sleep(100);
        }
 catch (        final InterruptedException e) {
          return Status.OK_STATUS;
        }
      }
      monitor.done();
      return Status.OK_STATUS;
    }
  }
;
  job.schedule();
  fIndexingRequest=new TmfEventRequest<ITmfEvent>(ITmfEvent.class,range,offset,TmfDataRequest.ALL_DATA,fCheckpointInterval,ITmfDataRequest.ExecutionType.BACKGROUND){
    private ITmfTimestamp startTime=null;
    private ITmfTimestamp lastTime=null;
    @Override public void handleData(    final ITmfEvent event){
      super.handleData(event);
      if (event != null) {
        final ITmfTimestamp timestamp=event.getTimestamp();
        if (startTime == null) {
          startTime=timestamp.clone();
        }
        lastTime=timestamp.clone();
        if ((getNbRead() % fCheckpointInterval) == 0) {
          updateTraceStatus();
        }
      }
    }
    @Override public void handleSuccess(){
      updateTraceStatus();
    }
    @Override public void handleCompleted(){
      job.cancel();
      super.handleCompleted();
      fIsIndexing=false;
    }
    private void updateTraceStatus(){
      if (getNbRead() != 0) {
        signalNewTimeRange(startTime,lastTime);
      }
    }
  }
;
  fTrace.sendRequest(fIndexingRequest);
  if (waitForCompletion) {
    try {
      fIndexingRequest.waitForCompletion();
    }
 catch (    final InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void buildIndex(final long offset,final TmfTimeRange range,final boolean waitForCompletion){
synchronized (fTraceIndex) {
    if (fIsIndexing) {
      return;
    }
    fIsIndexing=true;
  }
  final Job job=new Job("String_Node_Str" + fTrace.getName() + "String_Node_Str"){
    @Override protected IStatus run(    final IProgressMonitor monitor){
      while (!monitor.isCanceled()) {
        try {
          Thread.sleep(100);
        }
 catch (        final InterruptedException e) {
          return Status.OK_STATUS;
        }
      }
      monitor.done();
      return Status.OK_STATUS;
    }
  }
;
  job.schedule();
  fIndexingRequest=new TmfEventRequest<ITmfEvent>(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) {
    }
  }
}