Program: 48766
Project: 48766
Buggy source:
public boolean execCmd(String user,String privateKeyFile,String hostIP,int sshPort,String command){
  AuAssert.check(command != null);
  connect(user,privateKeyFile,hostIP,sshPort);
  ChannelExec channel=null;
  logger.info("String_Node_Str");
  try {
    channel=(ChannelExec)session.openChannel("String_Node_Str");
    if (channel != null) {
      logger.debug("String_Node_Str");
      channel.setPty(true);
      channel.setCommand(command);
      BufferedReader in=new BufferedReader(new InputStreamReader(channel.getInputStream()));
      channel.connect();
      if (!channel.isConnected()) {
        logger.error("String_Node_Str");
      }
      StringBuilder buff=new StringBuilder();
      while (true) {
        String line=in.readLine();
        buff.append(line);
        if (channel.isClosed()) {
          int exitStatus=channel.getExitStatus();
          logger.debug("String_Node_Str" + exitStatus);
          logger.debug("String_Node_Str" + buff.toString());
          in.close();
          if (exitStatus == 0) {
            return true;
          }
 else {
            return false;
          }
        }
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
        }
      }
    }
 else {
      logger.error("String_Node_Str" + hostIP + "String_Node_Str");
      return false;
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  JSchException e) {
    e.printStackTrace();
  }
 finally {
    if (channel != null) {
      channel.disconnect();
    }
    if (session != null) {
      session.disconnect();
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean execCmd(String user,String privateKeyFile,String hostIP,int sshPort,String command){
  AuAssert.check(command != null);
  connect(user,privateKeyFile,hostIP,sshPort);
  ChannelExec channel=null;
  BufferedReader in=null;
  logger.info("String_Node_Str");
  try {
    channel=(ChannelExec)session.openChannel("String_Node_Str");
    if (channel != null) {
      logger.debug("String_Node_Str");
      channel.setPty(true);
      channel.setCommand(command);
      in=new BufferedReader(new InputStreamReader(channel.getInputStream()));
      channel.connect();
      if (!channel.isConnected()) {
        logger.error("String_Node_Str");
      }
      StringBuilder buff=new StringBuilder();
      while (true) {
        String line=in.readLine();
        buff.append(line);
        if (channel.isClosed()) {
          int exitStatus=channel.getExitStatus();
          logger.debug("String_Node_Str" + exitStatus);
          logger.debug("String_Node_Str" + buff.toString());
          if (exitStatus == 0) {
            return true;
          }
          return false;
        }
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException e) {
        }
      }
    }
 else {
      logger.error("String_Node_Str" + hostIP + "String_Node_Str");
      return false;
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  JSchException e) {
    e.printStackTrace();
  }
 finally {
    if (channel != null && channel.isConnected()) {
      channel.disconnect();
    }
    if (session != null && session.isConnected()) {
      session.disconnect();
    }
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
        String errorMsg="String_Node_Str" + e.getMessage();
        logger.error(errorMsg);
      }
    }
  }
  return false;
}