Program: 168071
Project: 168071
Buggy source:
/** 
 * This method writes the corpus into a R Dataframe and stores it to the specified output location.
 * @param outputLoc
 * @param cls
 * @throws Exception
 */
private static void writeRObj(String outputLoc,CorpusClass cls) throws Exception {
  String saveLocation="String_Node_Str" + outputLoc + File.separator+ cls.getParent().getCorpusName().replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ cls.getClassName().replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ "String_Node_Str";
  String corpusLocation=cls.getTacitLocation();
  File corpusDirectory=new File(corpusLocation);
  String corpusClassLocation="String_Node_Str";
  String[] jsonFiles=corpusDirectory.list();
  for (int i=0; i < jsonFiles.length; i++) {
    if (jsonFiles[i].endsWith("String_Node_Str")) {
      corpusClassLocation=corpusLocation + File.separator + jsonFiles[i];
      break;
    }
  }
  String corpusName=cls.getClassName();
  corpusName=corpusName.replace("String_Node_Str","String_Node_Str");
  ScriptEngineManager manager=new ScriptEngineManager();
  ScriptEngine engine=manager.getEngineByName("String_Node_Str");
  if (engine == null) {
    throw new Exception("String_Node_Str");
  }
  try {
    JSONParser jsonParser=new JSONParser();
    JSONArray entireJsonArray=(JSONArray)jsonParser.parse(new FileReader(new File(corpusClassLocation)));
    JSONObject firstJsonObject=(JSONObject)entireJsonArray.get(0);
    Set<String> keySet=firstJsonObject.keySet();
    Iterator<String> keyIterator=keySet.iterator();
    String key;
    String dataFrameHeader="String_Node_Str";
    while (keyIterator.hasNext()) {
      key=keyIterator.next();
      engine.eval(key + "String_Node_Str");
      dataFrameHeader=dataFrameHeader + key + "String_Node_Str";
    }
    dataFrameHeader=dataFrameHeader.substring(0,dataFrameHeader.length() - 1);
    Iterator<Object> arrayIterator=entireJsonArray.iterator();
    while (arrayIterator.hasNext()) {
      JSONObject singleJsonObject=(JSONObject)arrayIterator.next();
      keyIterator=keySet.iterator();
      while (keyIterator.hasNext()) {
        key=keyIterator.next();
        if (singleJsonObject.containsKey(key)) {
          String data=singleJsonObject.get(key).toString();
          data=data.toLowerCase().replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").trim();
          data=data.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").trim();
          engine.eval("String_Node_Str" + data.toString() + "String_Node_Str");
          engine.eval(key + "String_Node_Str" + key+ "String_Node_Str");
        }
 else {
          engine.eval(key + "String_Node_Str" + key+ "String_Node_Str");
        }
      }
    }
    engine.eval(corpusName + "String_Node_Str" + dataFrameHeader+ "String_Node_Str");
    engine.eval("String_Node_Str" + corpusName + "String_Node_Str"+ saveLocation+ "String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    ConsoleView.printlInConsoleln("String_Node_Str");
    return;
  }
  ConsoleView.printlInConsoleln("String_Node_Str");
  ConsoleView.printlInConsoleln("String_Node_Str" + saveLocation);
}

Fixed version (ground truth):
/** 
 * This method writes the corpus into a R Dataframe and stores it to the specified output location.
 * @param outputLoc
 * @param cls
 * @throws Exception
 */
private static void writeRObj(String outputLoc,CorpusClass cls) throws Exception {
  String saveLocation="String_Node_Str" + outputLoc + File.separator+ cls.getParent().getCorpusName().replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ cls.getClassName().replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ "String_Node_Str";
  saveLocation=saveLocation.replace("String_Node_Str","String_Node_Str");
  String corpusLocation=cls.getTacitLocation();
  File corpusDirectory=new File(corpusLocation);
  String corpusClassLocation="String_Node_Str";
  String[] jsonFiles=corpusDirectory.list();
  for (int i=0; i < jsonFiles.length; i++) {
    if (jsonFiles[i].endsWith("String_Node_Str")) {
      corpusClassLocation=corpusLocation + File.separator + jsonFiles[i];
      break;
    }
  }
  String corpusName=cls.getClassName();
  corpusName=corpusName.replace("String_Node_Str","String_Node_Str");
  ScriptEngineManager manager=new ScriptEngineManager();
  ScriptEngine engine=manager.getEngineByName("String_Node_Str");
  if (engine == null) {
    throw new Exception("String_Node_Str");
  }
  try {
    JSONParser jsonParser=new JSONParser();
    JSONArray entireJsonArray=(JSONArray)jsonParser.parse(new FileReader(new File(corpusClassLocation)));
    JSONObject firstJsonObject=(JSONObject)entireJsonArray.get(0);
    Set<String> keySet=firstJsonObject.keySet();
    Iterator<String> keyIterator=keySet.iterator();
    String key;
    String dataFrameHeader="String_Node_Str";
    while (keyIterator.hasNext()) {
      key=keyIterator.next();
      engine.eval(key + "String_Node_Str");
      dataFrameHeader=dataFrameHeader + key + "String_Node_Str";
    }
    dataFrameHeader=dataFrameHeader.substring(0,dataFrameHeader.length() - 1);
    Iterator<Object> arrayIterator=entireJsonArray.iterator();
    while (arrayIterator.hasNext()) {
      JSONObject singleJsonObject=(JSONObject)arrayIterator.next();
      keyIterator=keySet.iterator();
      while (keyIterator.hasNext()) {
        key=keyIterator.next();
        if (singleJsonObject.containsKey(key)) {
          String data=singleJsonObject.get(key).toString();
          data=data.toLowerCase().replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").trim();
          data=data.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").trim();
          engine.eval("String_Node_Str" + data.toString() + "String_Node_Str");
          engine.eval(key + "String_Node_Str" + key+ "String_Node_Str");
        }
 else {
          engine.eval(key + "String_Node_Str" + key+ "String_Node_Str");
        }
      }
    }
    engine.eval(corpusName + "String_Node_Str" + dataFrameHeader+ "String_Node_Str");
    engine.eval("String_Node_Str" + corpusName + "String_Node_Str"+ saveLocation+ "String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    ConsoleView.printlInConsoleln("String_Node_Str");
    return;
  }
  ConsoleView.printlInConsoleln("String_Node_Str");
  ConsoleView.printlInConsoleln("String_Node_Str" + saveLocation);
}