Program: 189219
Project: 189219
Buggy source:
public void onBuildPassed(Project project,PropertyTree config,PropertyTree appConfig,File dir,File output,Build build){
  boolean analyze=Boolean.parseBoolean(config.getProperty(CIApplication.CONFIGURATION_ANALYZE.getKey(),String.valueOf(CIApplication.CONFIGURATION_ANALYZE.getDefault())));
  if (analyze) {
    Writer buildOut=null;
    try {
      buildOut=new FileWriter(output,true);
      if (!canFindScanBuild()) {
        build.setWarnings(build.getWarnings() + 1);
        buildOut.write("String_Node_Str");
        return;
      }
 else {
        ArrayList<String> commands=new ArrayList<String>();
        commands.add("String_Node_Str");
        commands.add("String_Node_Str");
        File siteRepository=new File(new File(new File(new File(Manager.getStorageInstance().getDataDirectory(),"String_Node_Str"),"String_Node_Str"),project.getId()),"String_Node_Str");
        String outputPath=siteRepository.getPath();
        commands.add(outputPath);
        log.debug("String_Node_Str" + dir + "String_Node_Str"+ outputPath);
        appendXcodeCommands(config,commands,"String_Node_Str");
        Process process=Runtime.getRuntime().exec(commands.toArray(new String[commands.size()]),null,dir);
        StreamGobbler serr=new StreamGobbler(new InputStreamReader(process.getErrorStream()),buildOut);
        StreamGobbler sout=new StreamGobbler(new InputStreamReader(process.getInputStream()),buildOut);
        serr.start();
        sout.start();
        process.waitFor();
        waitStreamGobblersToComplete(serr,sout);
        IOUtil.close(process.getOutputStream());
        IOUtil.close(process.getErrorStream());
        IOUtil.close(process.getInputStream());
        process.destroy();
      }
    }
 catch (    InterruptedException e) {
    }
catch (    IOException e) {
      e.printStackTrace(new PrintWriter(buildOut));
      log.error("String_Node_Str",e);
    }
 finally {
      IOUtil.close(buildOut);
    }
    try {
      BufferedReader input=new BufferedReader(new FileReader(output));
      try {
        String line=null;
        while ((line=input.readLine()) != null) {
          Matcher mBugs=BUILD_LOG_BUGS_COUNT_PATTERN.matcher(line);
          if (mBugs.find()) {
            String bugCount=mBugs.group(1);
            int warnings=build.getWarnings() + Integer.parseInt(bugCount);
            build.setWarnings(warnings);
          }
          Matcher mOutDir=BUILD_LOG_OUTPUT_DIR_PATTERN.matcher(line);
          if (mOutDir.find()) {
            File outputDir=new File(mOutDir.group(1));
            File renamePath=new File(new File(new File(new File(new File(Manager.getStorageInstance().getDataDirectory(),"String_Node_Str"),"String_Node_Str"),project.getId()),"String_Node_Str"),"String_Node_Str" + build.getId());
            log.debug("String_Node_Str" + outputDir.getPath() + "String_Node_Str"+ renamePath.getPath());
            boolean success=outputDir.renameTo(renamePath);
            if (!success) {
              log.error("String_Node_Str" + outputDir.getPath() + "String_Node_Str"+ renamePath.getPath());
            }
            File indexFile=new File(renamePath,"String_Node_Str");
            File indexTmpFile=new File(renamePath,"String_Node_Str");
            String outputName=dir.getName();
            try {
              RenameBuildFromFileToFile(outputName + "String_Node_Str","String_Node_Str" + build.getId() + "String_Node_Str",indexFile,indexTmpFile);
            }
 catch (            IOException ex) {
              ex.printStackTrace();
            }
            success=indexTmpFile.renameTo(indexFile);
            if (!success) {
              log.error("String_Node_Str" + indexTmpFile.getPath() + "String_Node_Str"+ indexFile.getPath());
            }
          }
        }
      }
  finally {
        input.close();
      }
    }
 catch (    IOException ex) {
      ex.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void onBuildPassed(Project project,PropertyTree config,PropertyTree appConfig,File dir,File output,Build build){
  boolean analyze=Boolean.parseBoolean(config.getProperty(CIApplication.CONFIGURATION_ANALYZE.getKey(),String.valueOf(CIApplication.CONFIGURATION_ANALYZE.getDefault())));
  if (analyze) {
    Writer buildOut=null;
    try {
      buildOut=new FileWriter(output,true);
      if (!canFindScanBuild()) {
        build.setWarnings(build.getWarnings() + 1);
        buildOut.write("String_Node_Str");
        return;
      }
 else {
        ArrayList<String> commands=new ArrayList<String>();
        commands.add("String_Node_Str");
        commands.add("String_Node_Str");
        File siteRepository=new File(new File(new File(new File(Manager.getStorageInstance().getDataDirectory(),"String_Node_Str"),"String_Node_Str"),project.getId()),"String_Node_Str");
        String outputPath=siteRepository.getPath();
        commands.add(outputPath);
        log.debug("String_Node_Str" + dir + "String_Node_Str"+ outputPath);
        appendXcodeCommands(project,config,commands,dir,"String_Node_Str");
        Process process=Runtime.getRuntime().exec(commands.toArray(new String[commands.size()]),null,dir);
        StreamGobbler serr=new StreamGobbler(new InputStreamReader(process.getErrorStream()),buildOut);
        StreamGobbler sout=new StreamGobbler(new InputStreamReader(process.getInputStream()),buildOut);
        serr.start();
        sout.start();
        process.waitFor();
        waitStreamGobblersToComplete(serr,sout);
        IOUtil.close(process.getOutputStream());
        IOUtil.close(process.getErrorStream());
        IOUtil.close(process.getInputStream());
        process.destroy();
      }
    }
 catch (    InterruptedException e) {
    }
catch (    IOException e) {
      e.printStackTrace(new PrintWriter(buildOut));
      log.error("String_Node_Str",e);
    }
 finally {
      IOUtil.close(buildOut);
    }
    try {
      BufferedReader input=new BufferedReader(new FileReader(output));
      try {
        String line=null;
        while ((line=input.readLine()) != null) {
          Matcher mBugs=BUILD_LOG_BUGS_COUNT_PATTERN.matcher(line);
          if (mBugs.find()) {
            String bugCount=mBugs.group(1);
            int warnings=build.getWarnings() + Integer.parseInt(bugCount);
            build.setWarnings(warnings);
          }
          Matcher mOutDir=BUILD_LOG_OUTPUT_DIR_PATTERN.matcher(line);
          if (mOutDir.find()) {
            File outputDir=new File(mOutDir.group(1));
            File renamePath=new File(new File(new File(new File(new File(Manager.getStorageInstance().getDataDirectory(),"String_Node_Str"),"String_Node_Str"),project.getId()),"String_Node_Str"),"String_Node_Str" + build.getId());
            log.debug("String_Node_Str" + outputDir.getPath() + "String_Node_Str"+ renamePath.getPath());
            boolean success=outputDir.renameTo(renamePath);
            if (!success) {
              log.error("String_Node_Str" + outputDir.getPath() + "String_Node_Str"+ renamePath.getPath());
            }
            File indexFile=new File(renamePath,"String_Node_Str");
            File indexTmpFile=new File(renamePath,"String_Node_Str");
            String outputName=dir.getName();
            try {
              RenameBuildFromFileToFile(outputName + "String_Node_Str","String_Node_Str" + build.getId() + "String_Node_Str",indexFile,indexTmpFile);
            }
 catch (            IOException ex) {
              ex.printStackTrace();
            }
            success=indexTmpFile.renameTo(indexFile);
            if (!success) {
              log.error("String_Node_Str" + indexTmpFile.getPath() + "String_Node_Str"+ indexFile.getPath());
            }
          }
        }
      }
  finally {
        input.close();
      }
    }
 catch (    IOException ex) {
      ex.printStackTrace();
    }
  }
}