Program: 94622
Project: 94622
Buggy source:
protected Error.Type runRenderer(Job ajob){
  this.gui.status("String_Node_Str");
  String core_script="String_Node_Str";
  if (ajob.getUseGPU() && this.config.getGPUDevice() != null) {
    core_script+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + this.config.getGPUDevice().getCudaName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  }
 else {
    core_script+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  }
  File script_file=null;
  String command1[]=ajob.getRenderCommand().split("String_Node_Str");
  int size_command=command1.length + 2;
  if (this.config.getNbCores() > 0) {
    size_command+=2;
  }
  String[] command=new String[size_command];
  int index=0;
  for (int i=0; i < command1.length; i++) {
    if (command1[i].equals("String_Node_Str")) {
      command[index]=ajob.getScenePath();
      index+=1;
      command[index]="String_Node_Str";
      index+=1;
      try {
        script_file=File.createTempFile("String_Node_Str","String_Node_Str",this.config.workingDirectory);
        File file=new File(script_file.getAbsolutePath());
        FileWriter txt;
        txt=new FileWriter(file);
        PrintWriter out=new PrintWriter(txt);
        out.write(ajob.getScript());
        out.write("String_Node_Str");
        out.write(core_script);
        out.write("String_Node_Str");
        out.close();
        command[index]=script_file.getAbsolutePath();
      }
 catch (      IOException e) {
        return Error.Type.UNKNOWN;
      }
      script_file.deleteOnExit();
    }
 else     if (command1[i].equals("String_Node_Str")) {
      command[index]=ajob.getRendererPath();
      if (this.config.getNbCores() > 0) {
        index+=1;
        command[index]="String_Node_Str";
        index+=1;
        command[index]=Integer.toString(this.config.getNbCores());
      }
    }
 else     if (command1[i].equals("String_Node_Str")) {
      command[index]=this.config.workingDirectory.getAbsolutePath() + File.separator + ajob.getPrefixOutputImage();
    }
 else     if (command1[i].equals("String_Node_Str")) {
      command[index]=ajob.getFrameNumber();
    }
 else {
      command[index]=command1[i];
    }
    index+=1;
  }
  long rending_start=new Date().getTime();
  int nb_lines=0;
  try {
    String line;
    this.log.debug(Arrays.toString(command));
    OS os=OS.getOS();
    ajob.setProcess(os.exec(command));
    BufferedReader input=new BufferedReader(new InputStreamReader(ajob.getProcess().getInputStream()));
    long last_update_status=0;
    this.log.debug("String_Node_Str");
    while ((line=input.readLine()) != null) {
      nb_lines++;
      this.updateRenderingMemoryPeak(line,ajob);
      this.log.debug(line);
      if ((new Date().getTime() - last_update_status) > 2000) {
        this.updateRenderingStatus(line,nb_lines,ajob);
        last_update_status=new Date().getTime();
      }
    }
    input.close();
    this.log.debug("String_Node_Str");
  }
 catch (  Exception err) {
    StringWriter sw=new StringWriter();
    err.printStackTrace(new PrintWriter(sw));
    this.log.error("String_Node_Str" + err + "String_Node_Str"+ sw.toString());
    return Error.Type.FAILED_TO_EXECUTE;
  }
  long rending_end=new Date().getTime();
  if (script_file != null) {
    script_file.delete();
  }
  ajob.setRenderDuration((int)((rending_end - rending_start) / 1000 + 1));
  ajob.setMaxOutputNbLines(nb_lines);
  int exit_value=0;
  try {
    exit_value=ajob.getProcess().exitValue();
  }
 catch (  IllegalThreadStateException e) {
    exit_value=0;
  }
catch (  Exception e) {
    exit_value=0;
  }
  ajob.setProcess(null);
  final String namefile_without_extension=ajob.getPrefixOutputImage() + ajob.getFrameNumber();
  FilenameFilter textFilter=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.startsWith(namefile_without_extension);
    }
  }
;
  File[] files=this.config.workingDirectory.listFiles(textFilter);
  if (files.length == 0) {
    this.log.error("String_Node_Str" + namefile_without_extension + "String_Node_Str");
    String basename="String_Node_Str";
    try {
      basename=ajob.getPath().substring(0,ajob.getPath().lastIndexOf('.'));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    File crash_file=new File(this.config.workingDirectory + File.separator + basename+ "String_Node_Str");
    if (crash_file.exists()) {
      this.log.error("String_Node_Str");
      crash_file.delete();
      return Error.Type.RENDERER_CRASHED;
    }
    if (exit_value == 127 && ajob.getRenderDuration() < 10) {
      this.log.error("String_Node_Str" + ajob.getRenderDuration() + "String_Node_Str");
      return Error.Type.RENDERER_MISSING_LIBRARIES;
    }
    return Error.Type.NOOUTPUTFILE;
  }
 else {
    ajob.setOutputImagePath(files[0].getAbsolutePath());
    this.log.debug("String_Node_Str" + ajob.getOutputImagePath() + "String_Node_Str");
  }
  File scene_dir=new File(ajob.getSceneDirectory());
  long date_modification_scene_directory=(long)Utils.lastModificationTime(scene_dir);
  if (date_modification_scene_directory > rending_start) {
    scene_dir.delete();
  }
  this.gui.status(String.format("String_Node_Str",ajob.getRenderDuration() / 60,ajob.getRenderDuration() % 60));
  return Error.Type.OK;
}

Fixed version (ground truth):
protected Error.Type runRenderer(Job ajob){
  this.gui.status("String_Node_Str");
  String core_script="String_Node_Str";
  if (ajob.getUseGPU() && this.config.getGPUDevice() != null) {
    core_script+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + this.config.getGPUDevice().getCudaName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  }
 else {
    core_script+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  }
  File script_file=null;
  String command1[]=ajob.getRenderCommand().split("String_Node_Str");
  int size_command=command1.length + 2;
  if (this.config.getNbCores() > 0) {
    size_command+=2;
  }
  String[] command=new String[size_command];
  int index=0;
  for (int i=0; i < command1.length; i++) {
    if (command1[i].equals("String_Node_Str")) {
      command[index]=ajob.getScenePath();
      index+=1;
      command[index]="String_Node_Str";
      index+=1;
      try {
        script_file=File.createTempFile("String_Node_Str","String_Node_Str",this.config.workingDirectory);
        File file=new File(script_file.getAbsolutePath());
        FileWriter txt;
        txt=new FileWriter(file);
        PrintWriter out=new PrintWriter(txt);
        out.write(ajob.getScript());
        out.write("String_Node_Str");
        out.write(core_script);
        out.write("String_Node_Str");
        out.close();
        command[index]=script_file.getAbsolutePath();
      }
 catch (      IOException e) {
        return Error.Type.UNKNOWN;
      }
      script_file.deleteOnExit();
    }
 else     if (command1[i].equals("String_Node_Str")) {
      command[index]=ajob.getRendererPath();
      if (this.config.getNbCores() > 0) {
        index+=1;
        command[index]="String_Node_Str";
        index+=1;
        command[index]=Integer.toString(this.config.getNbCores());
      }
    }
 else     if (command1[i].equals("String_Node_Str")) {
      command[index]=this.config.workingDirectory.getAbsolutePath() + File.separator + ajob.getPrefixOutputImage();
    }
 else     if (command1[i].equals("String_Node_Str")) {
      command[index]=ajob.getFrameNumber();
    }
 else {
      command[index]=command1[i];
    }
    index+=1;
  }
  long rending_start=new Date().getTime();
  int nb_lines=0;
  try {
    String line;
    this.log.debug(Arrays.toString(command));
    OS os=OS.getOS();
    ajob.setProcess(os.exec(command));
    BufferedReader input=new BufferedReader(new InputStreamReader(ajob.getProcess().getInputStream()));
    long last_update_status=0;
    this.log.debug("String_Node_Str");
    try {
      while ((line=input.readLine()) != null) {
        nb_lines++;
        this.updateRenderingMemoryPeak(line,ajob);
        if ((new Date().getTime() - last_update_status) > 2000) {
          this.updateRenderingStatus(line,nb_lines,ajob);
          last_update_status=new Date().getTime();
        }
      }
      input.close();
    }
 catch (    IOException err1) {
      this.log.error("String_Node_Str" + err1);
    }
    this.log.debug("String_Node_Str");
  }
 catch (  Exception err) {
    StringWriter sw=new StringWriter();
    err.printStackTrace(new PrintWriter(sw));
    this.log.error("String_Node_Str" + err + "String_Node_Str"+ sw.toString());
    return Error.Type.FAILED_TO_EXECUTE;
  }
  long rending_end=new Date().getTime();
  if (script_file != null) {
    script_file.delete();
  }
  ajob.setRenderDuration((int)((rending_end - rending_start) / 1000 + 1));
  ajob.setMaxOutputNbLines(nb_lines);
  int exit_value=0;
  try {
    exit_value=ajob.getProcess().exitValue();
  }
 catch (  IllegalThreadStateException e) {
    exit_value=0;
  }
catch (  Exception e) {
    exit_value=0;
  }
  ajob.setProcess(null);
  final String namefile_without_extension=ajob.getPrefixOutputImage() + ajob.getFrameNumber();
  FilenameFilter textFilter=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.startsWith(namefile_without_extension);
    }
  }
;
  File[] files=this.config.workingDirectory.listFiles(textFilter);
  if (files.length == 0) {
    this.log.error("String_Node_Str" + namefile_without_extension + "String_Node_Str");
    String basename="String_Node_Str";
    try {
      basename=ajob.getPath().substring(0,ajob.getPath().lastIndexOf('.'));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    File crash_file=new File(this.config.workingDirectory + File.separator + basename+ "String_Node_Str");
    if (crash_file.exists()) {
      this.log.error("String_Node_Str");
      crash_file.delete();
      return Error.Type.RENDERER_CRASHED;
    }
    if (exit_value == 127 && ajob.getRenderDuration() < 10) {
      this.log.error("String_Node_Str" + ajob.getRenderDuration() + "String_Node_Str");
      return Error.Type.RENDERER_MISSING_LIBRARIES;
    }
    return Error.Type.NOOUTPUTFILE;
  }
 else {
    ajob.setOutputImagePath(files[0].getAbsolutePath());
    this.log.debug("String_Node_Str" + ajob.getOutputImagePath() + "String_Node_Str");
  }
  File scene_dir=new File(ajob.getSceneDirectory());
  long date_modification_scene_directory=(long)Utils.lastModificationTime(scene_dir);
  if (date_modification_scene_directory > rending_start) {
    scene_dir.delete();
  }
  this.gui.status(String.format("String_Node_Str",ajob.getRenderDuration() / 60,ajob.getRenderDuration() % 60));
  return Error.Type.OK;
}