Program: 189234
Project: 189234
Buggy source:
public void runBuild(Project project,PropertyTree config,PropertyTree appConfig,File dir,File output,Build build){
  if (!(project instanceof XCodeProject)) {
    return;
  }
  int result=-1;
  Writer buildOut=null;
  Process process=null;
  StreamGobbler serr=null, sout=null;
  try {
    buildOut=new FileWriter(output);
    prepareProject(project,dir,buildOut);
    ArrayList<String> commands=new ArrayList<String>();
    appendXcodeCommands(project,config,commands,dir,null);
    commands.add("String_Node_Str");
    process=Runtime.getRuntime().exec(commands.toArray(new String[2]),null,dir);
    serr=new StreamGobbler(new InputStreamReader(process.getErrorStream()),buildOut);
    sout=new StreamGobbler(new InputStreamReader(process.getInputStream()),buildOut);
    serr.start();
    sout.start();
    result=process.waitFor();
    if (result == 0) {
      waitStreamGobblersToComplete(serr,sout);
      IOUtil.close(process.getOutputStream());
      IOUtil.close(process.getErrorStream());
      IOUtil.close(process.getInputStream());
      process.destroy();
      commands.clear();
      appendXcodeCommands(project,config,commands,dir,null);
      process=Runtime.getRuntime().exec(commands.toArray(new String[commands.size()]),null,dir);
      serr=new StreamGobbler(new InputStreamReader(process.getErrorStream()),buildOut);
      sout=new StreamGobbler(new InputStreamReader(process.getInputStream()),buildOut);
      serr.start();
      sout.start();
      result=process.waitFor();
    }
  }
 catch (  InterruptedException e) {
  }
catch (  IOException e) {
    e.printStackTrace(new PrintWriter(buildOut));
    log.error("String_Node_Str",e);
  }
 finally {
    if (process != null) {
      if (serr != null && sout != null) {
        waitStreamGobblersToComplete(serr,sout);
      }
      IOUtil.close(process.getOutputStream());
      IOUtil.close(process.getErrorStream());
      IOUtil.close(process.getInputStream());
      process.destroy();
    }
  }
  IOUtil.close(buildOut);
  parseDatFiles(dir,build);
  build.setEndTime(new Date());
  if (result != 0) {
    build.setStatus(Build.BUILD_FAILED);
    onBuildFailed(project,config,appConfig,dir,output,build);
  }
 else {
    build.setStatus(Build.BUILD_SUCCEEDED);
    onBuildPassed(project,config,appConfig,dir,output,build);
  }
}

Fixed version (ground truth):
public void runBuild(Project project,PropertyTree config,PropertyTree appConfig,File dir,File output,Build build){
  if (!(project instanceof XCodeProject)) {
    return;
  }
  int result=-1;
  Writer buildOut=null;
  Process process=null;
  StreamGobbler serr=null, sout=null;
  try {
    buildOut=new FileWriter(output);
    prepareProject(project,dir,buildOut);
    ArrayList<String> commands=new ArrayList<String>();
    appendXcodeCommands(project,config,commands,dir,null);
    commands.add("String_Node_Str");
    process=Runtime.getRuntime().exec(commands.toArray(new String[2]),null,dir);
    serr=new StreamGobbler(new InputStreamReader(process.getErrorStream()),buildOut);
    sout=new StreamGobbler(new InputStreamReader(process.getInputStream()),buildOut);
    serr.start();
    sout.start();
    result=process.waitFor();
    if (result == 0) {
      waitStreamGobblersToComplete(serr,sout);
      IOUtil.close(process.getOutputStream());
      IOUtil.close(process.getErrorStream());
      IOUtil.close(process.getInputStream());
      process.destroy();
      commands.clear();
      appendXcodeCommands(project,config,commands,dir,null);
      process=Runtime.getRuntime().exec(commands.toArray(new String[commands.size()]),null,dir);
      serr=new StreamGobbler(new InputStreamReader(process.getErrorStream()),buildOut);
      sout=new StreamGobbler(new InputStreamReader(process.getInputStream()),buildOut);
      serr.start();
      sout.start();
      result=process.waitFor();
    }
  }
 catch (  InterruptedException e) {
  }
catch (  IOException e) {
    e.printStackTrace(new PrintWriter(buildOut));
    log.error("String_Node_Str",e);
  }
 finally {
    if (process != null) {
      if (serr != null && sout != null) {
        waitStreamGobblersToComplete(serr,sout);
      }
      IOUtil.close(process.getOutputStream());
      IOUtil.close(process.getErrorStream());
      IOUtil.close(process.getInputStream());
      process.destroy();
    }
  }
  IOUtil.close(buildOut);
  parseDatFiles(dir,build);
  build.setEndTime(new Date());
  if (result != 0) {
    build.setStatus(Build.BUILD_FAILED);
    onBuildFailed(project,config,appConfig,dir,output,build);
  }
 else {
    build.setStatus(Build.BUILD_SUCCEEDED);
    onBuildPassed(project,config,appConfig,dir,output,build);
  }
  cleanupBuildOutput(build,dir);
}