Program: 92646
Project: 92646
Buggy source:
/** 
 * @param < T >
 * @param k
 * @param startIdx , > 0 and between 0 - 31
 * @param endIdx , > startIdx and between 0 - 31
 * @param printFirst20 , print the first expected events vs actual events
 * @return
 */
protected <T extends LttngEvent>TmfEventRequest<T> prepareEventRequest(Class<T> k,final int startIdx,int endIdx,final boolean printFirst20){
  if (!(endIdx > startIdx && startIdx >= 0 && endIdx <= 31)) {
    TraceDebug.debug("String_Node_Str");
    return null;
  }
  int DEFAULT_CHUNK=1;
  TmfTimeRange trange=new TmfTimeRange(new LttngTimestamp(requestIntervals_T1[startIdx]),new LttngTimestamp(requestIntervals_T1[endIdx]));
  validSequence=true;
  TmfEventRequest<T> request=new TmfEventRequest<T>(k,trange,TmfDataRequest.ALL_DATA,DEFAULT_CHUNK){
    @Override public void handleData(    T event){
      if (event == null) {
        System.out.println("String_Node_Str" + feventCount);
        return;
      }
      if (event instanceof LttngSyntheticEvent) {
        if (((LttngSyntheticEvent)event).getSynType() != SequenceInd.BEFORE) {
          return;
        }
      }
      if (printFirst20 && feventCount < 20) {
        long timevalue=event.getTimestamp().getValue();
        if (timevalue != expectedEvents_T1[feventCount]) {
          validSequence=false;
          System.out.println("String_Node_Str" + expectedEvents_T1[feventCount] + "String_Node_Str"+ event.getTimestamp().getValue());
        }
 else {
          System.out.println("String_Node_Str" + feventCount + "String_Node_Str");
        }
      }
      incrementCount();
    }
    /** 
 * possibly increased by multiple request threads
 */
    private synchronized void incrementCount(){
      feventCount++;
    }
    @Override public void handleCompleted(){
      System.out.println("String_Node_Str" + startIdx + "String_Node_Str"+ feventCount);
    }
  }
;
  return request;
}

Fixed version (ground truth):
/** 
 * @param < T >
 * @param k
 * @param startIdx , > 0 and between 0 - 31
 * @param endIdx , > startIdx and between 0 - 31
 * @param printFirst20 , print the first expected events vs actual events
 * @return
 */
protected <T extends LttngEvent>TmfEventRequest<T> prepareEventRequest(Class<T> k,final int startIdx,int endIdx,final boolean printFirst20){
  if (!(endIdx > startIdx && startIdx >= 0 && endIdx <= 31)) {
    TraceDebug.debug("String_Node_Str");
    return null;
  }
  int DEFAULT_CHUNK=1;
  TmfTimeRange trange=new TmfTimeRange(new LttngTimestamp(requestIntervals_T1[startIdx]),new LttngTimestamp(requestIntervals_T1[endIdx]));
  validSequence=true;
  TmfEventRequest<T> request=new TmfEventRequest<T>(k,trange,TmfDataRequest.ALL_DATA,DEFAULT_CHUNK){
    @Override public void handleData(    T event){
      if (event == null) {
        System.out.println("String_Node_Str" + feventCount);
        return;
      }
      if (event instanceof LttngSyntheticEvent) {
        if (((LttngSyntheticEvent)event).getSynType() != SequenceInd.BEFORE) {
          return;
        }
      }
      if (printFirst20 && feventCount < 20) {
        long timevalue=event.getTimestamp().getValue();
        if (timevalue != expectedEvents_T1[feventCount]) {
          validSequence=false;
          System.out.println("String_Node_Str" + expectedEvents_T1[feventCount] + "String_Node_Str"+ event.getTimestamp().getValue());
        }
      }
      incrementCount();
    }
    /** 
 * possibly increased by multiple request threads
 */
    private synchronized void incrementCount(){
      feventCount++;
    }
    @Override public void handleCompleted(){
    }
  }
;
  return request;
}