Program: 92133
Project: 92133
Buggy source:
private synchronized void initializeStreamingMonitor(){
  if (fInitialized) {
    return;
  }
  fInitialized=true;
  if (getStreamingInterval() == 0) {
    final ITmfContext context=seekEvent(0);
    final ITmfEvent event=getNext(context);
    if (event == null) {
      return;
    }
    final TmfTimeRange timeRange=new TmfTimeRange(event.getTimestamp().clone(),TmfTimestamp.BIG_CRUNCH);
    final TmfExperimentRangeUpdatedSignal signal=new TmfExperimentRangeUpdatedSignal(this,this,timeRange);
    new Thread(){
      @Override public void run(){
        broadcast(signal);
      }
    }
.start();
    return;
  }
  final Thread thread=new Thread("String_Node_Str" + getName()){
    private ITmfTimestamp safeTimestamp=null;
    private ITmfTimestamp lastSafeTimestamp=null;
    private TmfTimeRange timeRange=null;
    @Override public void run(){
      while (!fExecutor.isShutdown()) {
        if (!getIndexer().isIndexing()) {
          ITmfTimestamp startTimestamp=TmfTimestamp.BIG_CRUNCH;
          ITmfTimestamp endTimestamp=TmfTimestamp.BIG_BANG;
          for (          final ITmfTrace<T> trace : fTraces) {
            if (trace.getStartTime().compareTo(startTimestamp) < 0) {
              startTimestamp=trace.getStartTime();
            }
            if (trace.getStreamingInterval() != 0 && trace.getEndTime().compareTo(endTimestamp) > 0) {
              endTimestamp=trace.getEndTime();
            }
          }
          if (safeTimestamp != null && (lastSafeTimestamp == null || safeTimestamp.compareTo(lastSafeTimestamp,false) > 0)) {
            timeRange=new TmfTimeRange(startTimestamp,safeTimestamp);
            lastSafeTimestamp=safeTimestamp;
          }
 else {
            timeRange=null;
          }
          safeTimestamp=endTimestamp;
          if (timeRange != null) {
            final TmfExperimentRangeUpdatedSignal signal=new TmfExperimentRangeUpdatedSignal(TmfExperiment.this,TmfExperiment.this,timeRange);
            broadcast(signal);
          }
        }
        try {
          Thread.sleep(getStreamingInterval());
        }
 catch (        final InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  thread.start();
}

Fixed version (ground truth):
private synchronized void initializeStreamingMonitor(){
  if (fInitialized) {
    return;
  }
  fInitialized=true;
  if (getStreamingInterval() == 0) {
    final ITmfContext context=seekEvent(0);
    final ITmfEvent event=getNext(context);
    context.dispose();
    if (event == null) {
      return;
    }
    final TmfTimeRange timeRange=new TmfTimeRange(event.getTimestamp().clone(),TmfTimestamp.BIG_CRUNCH);
    final TmfExperimentRangeUpdatedSignal signal=new TmfExperimentRangeUpdatedSignal(this,this,timeRange);
    new Thread(){
      @Override public void run(){
        broadcast(signal);
      }
    }
.start();
    return;
  }
  final Thread thread=new Thread("String_Node_Str" + getName()){
    private ITmfTimestamp safeTimestamp=null;
    private ITmfTimestamp lastSafeTimestamp=null;
    private TmfTimeRange timeRange=null;
    @Override public void run(){
      while (!fExecutor.isShutdown()) {
        if (!getIndexer().isIndexing()) {
          ITmfTimestamp startTimestamp=TmfTimestamp.BIG_CRUNCH;
          ITmfTimestamp endTimestamp=TmfTimestamp.BIG_BANG;
          for (          final ITmfTrace<T> trace : fTraces) {
            if (trace.getStartTime().compareTo(startTimestamp) < 0) {
              startTimestamp=trace.getStartTime();
            }
            if (trace.getStreamingInterval() != 0 && trace.getEndTime().compareTo(endTimestamp) > 0) {
              endTimestamp=trace.getEndTime();
            }
          }
          if (safeTimestamp != null && (lastSafeTimestamp == null || safeTimestamp.compareTo(lastSafeTimestamp,false) > 0)) {
            timeRange=new TmfTimeRange(startTimestamp,safeTimestamp);
            lastSafeTimestamp=safeTimestamp;
          }
 else {
            timeRange=null;
          }
          safeTimestamp=endTimestamp;
          if (timeRange != null) {
            final TmfExperimentRangeUpdatedSignal signal=new TmfExperimentRangeUpdatedSignal(TmfExperiment.this,TmfExperiment.this,timeRange);
            broadcast(signal);
          }
        }
        try {
          Thread.sleep(getStreamingInterval());
        }
 catch (        final InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  thread.start();
}