Program: 92979
Project: 92979
Buggy source:
@Override public TmfEvent getNextEvent(TmfTraceContext context){
  String tmpContent=null;
  int tmpCurIndex=0;
  int tmpPrevIndex=0;
  String tracefile="String_Node_Str";
  long tmpCpu=0;
  String marker="String_Node_Str";
  long tmpSecond=0;
  long tmpNanosecond=0;
  String parsedPayload="String_Node_Str";
  String markerName="String_Node_Str";
  Object payload="String_Node_Str";
  HashMap<String,LttngEventField> fieldsMap=null;
  LttngEvent returnedEvent=null;
  try {
    tmpContent=br.readLine();
    if (tmpContent != null) {
      nbCharRead+=(tmpContent.length() + 1);
      if ((currentLttngEvent != null) && (currentLttngEvent.getContent().getRawContent() != null)) {
        currentLttngEvent.getContent().emptyContent();
      }
      eventSource.setSourceId("String_Node_Str");
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      if (tmpCurIndex < 0) {
        if (showDebug == true) {
          System.out.println("String_Node_Str");
          System.out.println();
        }
        return returnedEvent;
      }
      tracefile=tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim();
      tmpPrevIndex=tmpCurIndex;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      marker=tmpContent.substring(tmpPrevIndex + 1,tmpCurIndex).trim();
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpSecond=Long.parseLong(tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim());
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpNanosecond=Long.parseLong(tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim());
      eventTimestamp.setValue((tmpSecond * 1000000000) + tmpNanosecond);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      String fullTracePath=tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim();
      eventReference.setValue(fullTracePath);
      String traceName=fullTracePath.substring(fullTracePath.lastIndexOf("String_Node_Str") + 1).trim();
      eventReference.setTracepath(traceName);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 2;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpCpu=Long.parseLong(tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim());
      if (cpuNumber < (tmpCpu + 1)) {
        cpuNumber=(int)(tmpCpu + 1);
      }
      int tmpIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      if (tmpIndex != -1) {
        tmpPrevIndex=tmpCurIndex + 1;
        tmpCurIndex=tmpIndex;
        tmpPrevIndex=tmpCurIndex + 1;
        tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
        parsedPayload=tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim();
        boolean isDone=false;
        int tmpIndexBegin=0;
        int tmpIndexEqual=0;
        int tmpIndexEnd=0;
        fieldsMap=new HashMap<String,LttngEventField>();
        while (isDone == false) {
          tmpIndexEqual=parsedPayload.indexOf("String_Node_Str",(int)tmpIndexBegin);
          tmpIndexEnd=parsedPayload.indexOf("String_Node_Str",(int)tmpIndexEqual);
          if (tmpIndexEnd == -1) {
            tmpIndexEnd=parsedPayload.length();
            isDone=true;
          }
          markerName=parsedPayload.substring((int)tmpIndexBegin,(int)tmpIndexEqual - 1).trim();
          payload=((String)parsedPayload.substring((int)tmpIndexEqual + 1,(int)tmpIndexEnd)).replace("String_Node_Str","String_Node_Str").trim();
          try {
            payload=Long.parseLong((String)payload);
          }
 catch (          NumberFormatException e) {
          }
          LttngEventField tmpField=new LttngEventField(eventContent,markerName,payload);
          fieldsMap.put(markerName,tmpField);
          tmpIndexBegin=tmpIndexEnd + 1;
        }
        eventContent=new TextLttngEventContent(currentLttngEvent,fieldsMap);
        String tmpTypeKey=tracefile + "String_Node_Str" + tmpCpu+ "String_Node_Str"+ marker;
        if (traceTypes.get(tmpTypeKey) == null) {
          traceTypes.put(tmpTypeKey,new LttngEventType(tracefile,tmpCpu,marker,fieldsMap.keySet().toArray(new String[fieldsMap.size()])));
        }
        currentLttngEvent.setContent(eventContent);
        currentLttngEvent.setType(traceTypes.get(tmpTypeKey));
      }
      context.setTimestamp(eventTimestamp);
      context.setLocation(nbCharRead);
      returnedEvent=currentLttngEvent;
    }
 else     if (showDebug == true) {
      System.out.println("String_Node_Str");
      System.out.println();
    }
  }
 catch (  Exception e) {
    if (tmpContent != null) {
      System.out.println("String_Node_Str" + nbCharRead);
      System.out.println("String_Node_Str" + tmpContent);
    }
    tmpContent=null;
    e.printStackTrace();
  }
  return returnedEvent;
}

Fixed version (ground truth):
@Override public TmfEvent getNextEvent(TmfTraceContext context){
  String tmpContent=null;
  int tmpCurIndex=0;
  int tmpPrevIndex=0;
  String tracefile="String_Node_Str";
  long tmpCpu=0;
  String marker="String_Node_Str";
  long tmpSecond=0;
  long tmpNanosecond=0;
  String parsedPayload="String_Node_Str";
  String markerName="String_Node_Str";
  Object payload="String_Node_Str";
  HashMap<String,LttngEventField> fieldsMap=null;
  LttngEvent returnedEvent=null;
  try {
    tmpContent=br.readLine();
    if (tmpContent != null) {
      nbCharRead+=(tmpContent.length() + 1);
      if ((currentLttngEvent != null) && (currentLttngEvent.getContent().getRawContent() != null)) {
        currentLttngEvent.getContent().emptyContent();
      }
      eventSource.setSourceId("String_Node_Str");
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      if (tmpCurIndex < 0) {
        if (showDebug == true) {
          System.out.println("String_Node_Str");
          System.out.println();
        }
        return returnedEvent;
      }
      tracefile=tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim();
      tmpPrevIndex=tmpCurIndex;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      marker=tmpContent.substring(tmpPrevIndex + 1,tmpCurIndex).trim();
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpSecond=Long.parseLong(tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim());
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpNanosecond=Long.parseLong(tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim());
      eventTimestamp.setValue((tmpSecond * 1000000000) + tmpNanosecond);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      String fullTracePath=tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim();
      eventReference.setValue(fullTracePath);
      String traceName=fullTracePath.substring(fullTracePath.lastIndexOf("String_Node_Str") + 1).trim();
      eventReference.setTracepath(traceName);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 1;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpPrevIndex=tmpCurIndex + 2;
      tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      tmpCpu=Long.parseLong(tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim());
      if (cpuNumber < (tmpCpu + 1)) {
        cpuNumber=(int)(tmpCpu + 1);
      }
      int tmpIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
      if (tmpIndex != -1) {
        tmpPrevIndex=tmpCurIndex + 1;
        tmpCurIndex=tmpIndex;
        tmpPrevIndex=tmpCurIndex + 1;
        tmpCurIndex=tmpContent.indexOf("String_Node_Str",tmpPrevIndex);
        parsedPayload=tmpContent.substring(tmpPrevIndex,tmpCurIndex).trim();
        boolean isDone=false;
        int tmpIndexBegin=0;
        int tmpIndexEqual=0;
        int tmpIndexEnd=0;
        fieldsMap=new HashMap<String,LttngEventField>();
        while (isDone == false) {
          tmpIndexEqual=parsedPayload.indexOf("String_Node_Str",(int)tmpIndexBegin);
          tmpIndexEnd=parsedPayload.indexOf("String_Node_Str",(int)tmpIndexEqual);
          if (tmpIndexEnd == -1) {
            tmpIndexEnd=parsedPayload.length();
            isDone=true;
          }
          markerName=parsedPayload.substring((int)tmpIndexBegin,(int)tmpIndexEqual - 1).trim();
          payload=((String)parsedPayload.substring((int)tmpIndexEqual + 1,(int)tmpIndexEnd)).replace("String_Node_Str","String_Node_Str").trim();
          try {
            payload=Long.parseLong((String)payload);
          }
 catch (          NumberFormatException e) {
          }
          LttngEventField tmpField=new LttngEventField(eventContent,markerName,payload);
          fieldsMap.put(markerName,tmpField);
          tmpIndexBegin=tmpIndexEnd + 1;
        }
      }
 else {
        fieldsMap=new HashMap<String,LttngEventField>();
        markerName="String_Node_Str";
        payload="String_Node_Str";
        LttngEventField tmpField=new LttngEventField(eventContent,markerName,payload);
        fieldsMap.put(markerName,tmpField);
      }
      eventContent=new TextLttngEventContent(currentLttngEvent,fieldsMap);
      String tmpTypeKey=tracefile + "String_Node_Str" + tmpCpu+ "String_Node_Str"+ marker;
      if (traceTypes.get(tmpTypeKey) == null) {
        traceTypes.put(tmpTypeKey,new LttngEventType(tracefile,tmpCpu,marker,fieldsMap.keySet().toArray(new String[fieldsMap.size()])));
      }
      currentLttngEvent.setContent(eventContent);
      currentLttngEvent.setType(traceTypes.get(tmpTypeKey));
      context.setTimestamp(eventTimestamp);
      context.setLocation(nbCharRead);
      returnedEvent=currentLttngEvent;
    }
 else     if (showDebug == true) {
      System.out.println("String_Node_Str");
      System.out.println();
      returnedEvent=null;
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + nbCharRead);
    if (tmpContent != null) {
      System.out.println("String_Node_Str" + tmpContent);
    }
    tmpContent=null;
    e.printStackTrace();
    returnedEvent=null;
  }
  return returnedEvent;
}