Program: 92581
Project: 92581
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public ITmfContext armRequest(final ITmfDataRequest<LttngSyntheticEvent> request){
  if (!(request instanceof ITmfEventRequest<?>)) {
    request.cancel();
    TraceDebug.debug("String_Node_Str");
    return null;
  }
  if (fExperiment == null) {
    TraceDebug.debug("String_Node_Str");
    request.cancel();
    return null;
  }
  reset(fExperiment);
  if (fEventProviderRequests.size() < 1) {
    request.cancel();
    TraceDebug.debug("String_Node_Str");
    return null;
  }
  fmainRequest=request;
  ITmfEventRequest<LttngSyntheticEvent> eventRequest=(ITmfEventRequest<LttngSyntheticEvent>)fmainRequest;
  TmfTimeRange reqWindow=eventRequest.getRange();
  TraceDebug.debug("String_Node_Str" + Thread.currentThread().getName());
  TmfExperiment<LttngEvent> experiment=(TmfExperiment<LttngEvent>)fExperiment.getValue();
  experiment.startSynch(new TmfStartSynchSignal(0));
  TmfTimeRange adjustedRange=reqWindow;
  long adjustedIndex=eventRequest.getIndex();
  int nbRequested=eventRequest.getNbRequested();
  IStateTraceManager traceManager;
  Iterator<IStateTraceManager> iter=fEventProviderRequests.iterator();
  while (iter.hasNext()) {
    traceManager=iter.next();
    TmfCheckpoint checkPoint=null;
    if (eventRequest.getIndex() > 0) {
      checkPoint=traceManager.restoreCheckPointByIndex(eventRequest.getIndex());
    }
 else {
      checkPoint=traceManager.restoreCheckPointByTimestamp(reqWindow.getStartTime());
    }
    TmfTimeRange traceRange=traceManager.getStateTrace().getTimeRange();
    if ((checkPoint == null) || checkPoint.getTimestamp().getValue() < traceRange.getStartTime().getValue() || checkPoint.getTimestamp().getValue() > traceRange.getEndTime().getValue() || checkPoint.getTimestamp().getValue() >= reqWindow.getEndTime().getValue()) {
    }
 else {
      if (adjustedRange.getStartTime().getValue() > checkPoint.getTimestamp().getValue() || adjustedIndex > (Long)checkPoint.getLocation().getLocation()) {
        adjustedRange=new TmfTimeRange(checkPoint.getTimestamp(),reqWindow.getEndTime());
        adjustedIndex=(Long)checkPoint.getLocation().getLocation();
        if (nbRequested < TmfDataRequest.ALL_DATA) {
          nbRequested+=(eventRequest.getIndex() - adjustedIndex);
        }
      }
    }
    traceToTraceStateModel.put(traceManager.getStateTrace(),traceManager.getStateModel());
  }
  dispatchTime=reqWindow.getStartTime().getValue();
  dispatchIndex=eventRequest.getIndex();
  eventIndex=adjustedIndex;
  fSubRequest=new LttngBaseEventRequest(adjustedRange,reqWindow.getStartTime(),adjustedIndex,nbRequested,BLOCK_SIZE,eventRequest.getExecType()){
    private LttngSyntheticEvent syntheticEvent=null;
    @Override public void handleData(    LttngEvent event){
      super.handleData(event);
      if (event != null) {
synchronized (LttngSyntheticEventProvider.this) {
          if ((fmainRequest == null) || (fmainRequest.isCompleted())) {
            TraceDebug.debug("String_Node_Str" + event);
            return;
          }
          handleIncomingData(event);
        }
      }
 else {
        TraceDebug.debug("String_Node_Str");
      }
    }
    @Override public void handleCompleted(){
      handleProviderDone(!isCancelled() && !isFailed());
      super.handleCompleted();
    }
    /** 
 * Trigger the Analysis and sequential control of the events.
 * @param e
 */
    private void handleIncomingData(    LttngEvent e){
      long eventTime=e.getTimestamp().getValue();
      ITmfTrace<?> inTrace=e.getTrace();
      LttngTraceState traceModel=traceToTraceStateModel.get(inTrace);
      updateSynEvent(e);
      if (eventTime >= dispatchTime && eventIndex >= dispatchIndex) {
        syntheticEvent.setSequenceInd(SequenceInd.BEFORE);
        fmainRequest.handleData(syntheticEvent);
        syntheticEvent.setSequenceInd(SequenceInd.UPDATE);
        fstateUpdateProcessor.process(syntheticEvent,traceModel);
        syntheticEvent.setSequenceInd(SequenceInd.AFTER);
        fmainRequest.handleData(syntheticEvent);
      }
 else {
        syntheticEvent.setSequenceInd(SequenceInd.UPDATE);
        fstateUpdateProcessor.process(syntheticEvent,traceModel);
      }
      eventIndex++;
    }
    /** 
 * Create a synthetic event from the received new reference, if the reference is the same there is no need for a new instance if this is the first event for this request, call start handler
 * @param e
 * @return
 */
    private LttngSyntheticEvent updateSynEvent(    LttngEvent e){
      if ((syntheticEvent == null) || (syntheticEvent.getBaseEvent() != e)) {
        syntheticEvent=new LttngSyntheticEvent(e);
      }
      ITmfTrace<?> inTrace=e.getTrace();
      LttngTraceState traceModel=traceToTraceStateModel.get(inTrace);
      syntheticEvent.setTraceModel(traceModel);
      if (!startIndSent) {
        TraceDebug.debug("String_Node_Str" + Thread.currentThread().getName());
        handleProviderStarted(traceModel);
        startIndSent=true;
      }
      return syntheticEvent;
    }
  }
;
  TmfExperiment<LttngEvent> provider=(TmfExperiment<LttngEvent>)fExperiment.getValue();
  provider.sendRequest(fSubRequest);
synchronized (this) {
    TmfExperiment.getCurrentExperiment().notifyPendingRequest(false);
    fIsExperimentNotified=false;
  }
  experiment.endSynch(new TmfEndSynchSignal(0));
  return new TmfContext();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public synchronized ITmfContext armRequest(final ITmfDataRequest<LttngSyntheticEvent> request){
  if (!(request instanceof ITmfEventRequest<?>)) {
    request.cancel();
    TraceDebug.debug("String_Node_Str");
    return null;
  }
  if (fExperiment == null) {
    TraceDebug.debug("String_Node_Str");
    request.cancel();
    return null;
  }
  reset(fExperiment);
  if (fEventProviderRequests.size() < 1) {
    request.cancel();
    TraceDebug.debug("String_Node_Str");
    return null;
  }
  fmainRequest=request;
  ITmfEventRequest<LttngSyntheticEvent> eventRequest=(ITmfEventRequest<LttngSyntheticEvent>)fmainRequest;
  TmfTimeRange reqWindow=eventRequest.getRange();
  TraceDebug.debug("String_Node_Str" + Thread.currentThread().getName());
  TmfExperiment<LttngEvent> experiment=(TmfExperiment<LttngEvent>)fExperiment.getValue();
  experiment.startSynch(new TmfStartSynchSignal(0));
  TmfTimeRange adjustedRange=reqWindow;
  long adjustedIndex=eventRequest.getIndex();
  int nbRequested=eventRequest.getNbRequested();
  IStateTraceManager traceManager;
  Iterator<IStateTraceManager> iter=fEventProviderRequests.iterator();
  while (iter.hasNext()) {
    traceManager=iter.next();
    TmfCheckpoint checkPoint=null;
    if (eventRequest.getIndex() > 0) {
      checkPoint=traceManager.restoreCheckPointByIndex(eventRequest.getIndex());
    }
 else {
      checkPoint=traceManager.restoreCheckPointByTimestamp(reqWindow.getStartTime());
    }
    TmfTimeRange traceRange=traceManager.getStateTrace().getTimeRange();
    if ((checkPoint == null) || checkPoint.getTimestamp().getValue() < traceRange.getStartTime().getValue() || checkPoint.getTimestamp().getValue() > traceRange.getEndTime().getValue() || checkPoint.getTimestamp().getValue() >= reqWindow.getEndTime().getValue()) {
    }
 else {
      if (adjustedRange.getStartTime().getValue() > checkPoint.getTimestamp().getValue() || adjustedIndex > (Long)checkPoint.getLocation().getLocation()) {
        adjustedRange=new TmfTimeRange(checkPoint.getTimestamp(),reqWindow.getEndTime());
        adjustedIndex=(Long)checkPoint.getLocation().getLocation();
        if (nbRequested < TmfDataRequest.ALL_DATA) {
          nbRequested+=(eventRequest.getIndex() - adjustedIndex);
        }
      }
    }
    traceToTraceStateModel.put(traceManager.getStateTrace(),traceManager.getStateModel());
  }
  dispatchTime=reqWindow.getStartTime().getValue();
  dispatchIndex=eventRequest.getIndex();
  eventIndex=adjustedIndex;
  fSubRequest=new LttngBaseEventRequest(adjustedRange,reqWindow.getStartTime(),adjustedIndex,nbRequested,BLOCK_SIZE,eventRequest.getExecType()){
    private LttngSyntheticEvent syntheticEvent=null;
    @Override public void handleData(    LttngEvent event){
      super.handleData(event);
      if (event != null) {
synchronized (LttngSyntheticEventProvider.this) {
          if ((fmainRequest == null) || (fmainRequest.isCompleted())) {
            TraceDebug.debug("String_Node_Str" + event);
            return;
          }
          handleIncomingData(event);
        }
      }
 else {
        TraceDebug.debug("String_Node_Str");
      }
    }
    @Override public void handleCompleted(){
      handleProviderDone(!isCancelled() && !isFailed());
      super.handleCompleted();
    }
    /** 
 * Trigger the Analysis and sequential control of the events.
 * @param e
 */
    private void handleIncomingData(    LttngEvent e){
      long eventTime=e.getTimestamp().getValue();
      ITmfTrace<?> inTrace=e.getTrace();
      LttngTraceState traceModel=traceToTraceStateModel.get(inTrace);
      updateSynEvent(e);
      if (eventTime >= dispatchTime && eventIndex >= dispatchIndex) {
        syntheticEvent.setSequenceInd(SequenceInd.BEFORE);
        fmainRequest.handleData(syntheticEvent);
        syntheticEvent.setSequenceInd(SequenceInd.UPDATE);
        fstateUpdateProcessor.process(syntheticEvent,traceModel);
        syntheticEvent.setSequenceInd(SequenceInd.AFTER);
        fmainRequest.handleData(syntheticEvent);
      }
 else {
        syntheticEvent.setSequenceInd(SequenceInd.UPDATE);
        fstateUpdateProcessor.process(syntheticEvent,traceModel);
      }
      eventIndex++;
    }
    /** 
 * Create a synthetic event from the received new reference, if the reference is the same there is no need for a new instance if this is the first event for this request, call start handler
 * @param e
 * @return
 */
    private LttngSyntheticEvent updateSynEvent(    LttngEvent e){
      if ((syntheticEvent == null) || (syntheticEvent.getBaseEvent() != e)) {
        syntheticEvent=new LttngSyntheticEvent(e);
      }
      ITmfTrace<?> inTrace=e.getTrace();
      LttngTraceState traceModel=traceToTraceStateModel.get(inTrace);
      syntheticEvent.setTraceModel(traceModel);
      if (!startIndSent) {
        TraceDebug.debug("String_Node_Str" + Thread.currentThread().getName());
        handleProviderStarted(traceModel);
        startIndSent=true;
      }
      return syntheticEvent;
    }
  }
;
  TmfExperiment<LttngEvent> provider=(TmfExperiment<LttngEvent>)fExperiment.getValue();
  provider.sendRequest(fSubRequest);
synchronized (this) {
    TmfExperiment.getCurrentExperiment().notifyPendingRequest(false);
    fIsExperimentNotified=false;
  }
  experiment.endSynch(new TmfEndSynchSignal(0));
  return new TmfContext();
}