Program: 141211
Project: 141211
Buggy source:
/** 
 * create a processBuilder for execute command and include a thread for get output stream which redirect to parserLine and a second thread for get error stream
 * @param cmd line command
 * @param temporaryDirectory
 * @param parserLine SAMParserLine which retrieve output stream
 * @return integer exit value for the process
 * @throws IOException if an error occurs while executing the command
 */
protected int sh(final List<String> cmd,final File temporaryDirectory,final SAMParserLine parserLine) throws IOException {
  ProcessBuilder pb;
  final Process p;
  int exitValue=Integer.MAX_VALUE;
  try {
    pb=new ProcessBuilder(cmd);
    if (!(temporaryDirectory == null))     pb.directory(temporaryDirectory);
    LOGGER.fine("String_Node_Str" + Thread.currentThread().getId() + "String_Node_Str"+ cmd.toString());
    p=pb.start();
    final Thread tout=new Thread(new Runnable(){
      @Override public void run(){
        if (parserLine != null) {
          try {
            InputStream is=p.getInputStream();
            BufferedReader buff=new BufferedReader(new InputStreamReader(is));
            String line="String_Node_Str";
            while ((line=buff.readLine()) != null) {
              parserLine.parseLine(line);
            }
          }
 catch (          IOException e) {
            e.printStackTrace();
          }
        }
      }
    }
);
    tout.start();
    final Thread terr=new Thread(new ProcessThreadErrOutput(p.getErrorStream()));
    terr.start();
    tout.join();
    terr.join();
    exitValue=p.waitFor();
  }
 catch (  InterruptedException e) {
    LOGGER.warning("String_Node_Str" + e.getMessage());
  }
  return exitValue;
}

Fixed version (ground truth):
/** 
 * create a processBuilder for execute command and include a thread for get output stream which redirect to parserLine and a second thread for get error stream
 * @param cmd line command
 * @param temporaryDirectory
 * @param parserLine SAMParserLine which retrieve output stream
 * @return integer exit value for the process
 * @throws IOException if an error occurs while executing the command
 */
protected int sh(final List<String> cmd,final File temporaryDirectory,final SAMParserLine parserLine) throws IOException {
  ProcessBuilder pb;
  final Process p;
  int exitValue=Integer.MAX_VALUE;
  try {
    pb=new ProcessBuilder(cmd);
    if (!(temporaryDirectory == null))     pb.directory(temporaryDirectory);
    LOGGER.fine("String_Node_Str" + Thread.currentThread().getId() + "String_Node_Str"+ cmd.toString());
    p=pb.start();
    final Thread tout=new Thread(new Runnable(){
      @Override public void run(){
        if (parserLine != null) {
          try {
            InputStream is=p.getInputStream();
            BufferedReader buff=new BufferedReader(new InputStreamReader(is));
            String line="String_Node_Str";
            while ((line=buff.readLine()) != null) {
              parserLine.parseLine(line);
            }
            buff.close();
          }
 catch (          IOException e) {
            e.printStackTrace();
          }
        }
      }
    }
);
    tout.start();
    final Thread terr=new Thread(new ProcessThreadErrOutput(p.getErrorStream()));
    terr.start();
    tout.join();
    terr.join();
    exitValue=p.waitFor();
  }
 catch (  InterruptedException e) {
    LOGGER.warning("String_Node_Str" + e.getMessage());
  }
  return exitValue;
}