Program: 140858
Project: 140858
Buggy source:
@Override public void addData(Properties meta,Triple[] data){
  String taskID=meta.getProperty(COMMON.EXPERIMENT_TASK_ID_KEY);
  String[] strArr=taskToDir.get(taskID);
  StringBuilder dir=new StringBuilder(strArr[0]);
  dir.append(meta.get(COMMON.METRICS_PROPERTIES_KEY));
  File dir1=new File(dir.toString());
  dir1.mkdirs();
  Integer extraLength=(Integer)meta.get(CONSTANTS.LENGTH_EXTRA_META_KEY);
  StringBuilder extraHash=new StringBuilder();
  int i=0;
  for (; i < extraLength - 1; i++) {
    extraHash.append(data[i].getPredicate().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str")).append("String_Node_Str").append(data[i].getObject().toString().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str")).append("String_Node_Str");
  }
  if (extraLength != 0) {
    extraHash.append(data[i].getPredicate().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str")).append("String_Node_Str").append(data[i].getObject().toString().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  }
  String fileName="String_Node_Str";
  if (extraHash.length() != 0) {
    fileName=extraHash.toString();
  }
 else {
    fileName=meta.get(COMMON.METRICS_PROPERTIES_KEY).toString();
  }
  File f=new File(dir.toString() + File.separator + fileName+ SUFFIX);
  String connID=strArr[1];
  if (f.exists()) {
    List<String> header;
    try (BufferedReader reader=new BufferedReader(new FileReader(f))){
      String[] headerArr=reader.readLine().split(SEPERATOR);
      header=Arrays.asList(headerArr);
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str" + f.getName(),e);
      return;
    }
    StringBuilder dataString=new StringBuilder();
    dataString.append(connID).append(SEPERATOR);
    String[] ordered=new String[data.length - extraLength];
    for (i=extraLength; i < data.length; i++) {
      Triple triple=data[i];
      String key=triple.getPredicate();
      int j=header.indexOf(key) - 1;
      ordered[j]=triple.getObject().toString();
    }
    for (i=0; i < ordered.length - 1; i++) {
      dataString.append(ordered[i]).append(SEPERATOR);
    }
    if (ordered.length != 0)     dataString.append(ordered[i]);
    try (PrintWriter pw=new PrintWriter(new FileOutputStream(f,true))){
      pw.println(dataString.toString());
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str" + f.getAbsolutePath(),e);
      return;
    }
  }
 else {
    try {
      f.createNewFile();
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str" + f.getAbsolutePath(),e);
      return;
    }
    StringBuilder headerString=new StringBuilder();
    headerString.append("String_Node_Str").append(SEPERATOR);
    StringBuilder dataString=new StringBuilder();
    dataString.append(connID).append(SEPERATOR);
    for (i=extraLength; i < data.length - 1; i++) {
      Triple triple=data[i];
      headerString.append(triple.getPredicate()).append(SEPERATOR);
      dataString.append(triple.getObject()).append(SEPERATOR);
    }
    if (data.length != 0) {
      Triple triple=data[i];
      headerString.append(triple.getPredicate());
      dataString.append(triple.getObject());
    }
    try (PrintWriter pw=new PrintWriter(new FileOutputStream(f,true))){
      pw.println(headerString.toString());
      pw.println(dataString.toString());
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str" + f.getAbsolutePath(),e);
      return;
    }
    taskFileExists.add(extraHash.toString());
  }
}

Fixed version (ground truth):
@Override public void addData(Properties meta,Triple[] data){
  String taskID=meta.getProperty(COMMON.EXPERIMENT_TASK_ID_KEY);
  String[] strArr=taskToDir.get(taskID);
  StringBuilder dir=new StringBuilder(strArr[0]);
  Integer extraLength=(Integer)meta.get(CONSTANTS.LENGTH_EXTRA_META_KEY);
  Integer index=0;
  StringBuilder extraHash=createExtraHash(index,extraLength,data);
  File f=getFileForExtraHash(taskID,dir,meta,extraHash.toString());
  String connID=strArr[1];
  if (f.exists()) {
    cachedFile(index,connID,f,extraLength,data);
  }
 else {
    uncachedFile(index,connID,f,extraLength,extraHash.toString(),data);
  }
}