Program: 89604
Project: 89604
Buggy source:
/** 
 * Create FTPClient and log on to ftp-server, if not already connected to ftp-server.  Attempts to set binary mode and passive mode. Will try to login up to FTP_RETRIES times, if login fails.
 */
private void logOn(){
  if (currentFTPClient != null && currentFTPClient.isConnected()) {
    return;
  }
 else {
    currentFTPClient=new FTPClient();
  }
  log.trace("String_Node_Str" + ftpUserName + "String_Node_Str"+ ftpUserPassword.replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ ftpServerName+ "String_Node_Str"+ ftpServerPort);
  int tries=0;
  boolean logOnSuccessful=false;
  while (!logOnSuccessful && tries < CommonSettings.FTP_RETRIES) {
    tries++;
    try {
      currentFTPClient.connect(ftpServerName,ftpServerPort);
      currentFTPClient.setDataTimeout(CommonSettings.FTP_DATATIMEOUT);
      if (!currentFTPClient.login(ftpUserName,ftpUserPassword)) {
        final String message="String_Node_Str" + SystemUtils.getLocalHostName() + "String_Node_Str"+ ftpServerName+ "String_Node_Str"+ ftpServerPort+ "String_Node_Str"+ ftpUserName+ "String_Node_Str"+ ftpUserPassword.replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ getFtpErrorMessage();
        log.warn(message);
        throw new IOFailure(message);
      }
      if (!currentFTPClient.setFileType(FTPClient.BINARY_FILE_TYPE)) {
        final String message="String_Node_Str" + ftpServerName + "String_Node_Str"+ getFtpErrorMessage();
        log.warn(message);
        throw new IOFailure(message);
      }
      currentFTPClient.enterLocalPassiveMode();
      log.debug("String_Node_Str" + currentFTPClient.getDefaultTimeout());
      logOnSuccessful=true;
    }
 catch (    IOException e) {
      final String msg="String_Node_Str" + ftpServerName + "String_Node_Str"+ SystemUtils.getLocalHostName()+ "String_Node_Str";
      if (tries < CommonSettings.FTP_RETRIES) {
        log.debug(msg + "String_Node_Str" + tries+ "String_Node_Str"+ CommonSettings.FTP_RETRIES+ "String_Node_Str"+ "String_Node_Str",e);
        TimeUtils.exponentialBackoffSleep(tries,Calendar.MINUTE);
      }
 else {
        log.warn(msg + "String_Node_Str" + tries+ "String_Node_Str");
        throw new IOFailure(msg,e);
      }
    }
  }
  log.debug("String_Node_Str" + ftpUserName + "String_Node_Str"+ ftpUserPassword.replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ ftpServerName+ "String_Node_Str"+ ftpServerPort);
}

Fixed version (ground truth):
/** 
 * Create FTPClient and log on to ftp-server, if not already connected to ftp-server.  Attempts to set binary mode and passive mode. Will try to login up to FTP_RETRIES times, if login fails.
 */
private void logOn(){
  if (currentFTPClient != null && currentFTPClient.isConnected()) {
    return;
  }
 else {
    currentFTPClient=new FTPClient();
  }
  log.trace("String_Node_Str" + ftpUserName + "String_Node_Str"+ ftpUserPassword.replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ ftpServerName+ "String_Node_Str"+ ftpServerPort);
  int tries=0;
  boolean logOnSuccessful=false;
  while (!logOnSuccessful && tries < FTP_RETRIES) {
    tries++;
    try {
      currentFTPClient.connect(ftpServerName,ftpServerPort);
      currentFTPClient.setDataTimeout(FTP_DATATIMEOUT);
      if (!currentFTPClient.login(ftpUserName,ftpUserPassword)) {
        final String message="String_Node_Str" + SystemUtils.getLocalHostName() + "String_Node_Str"+ ftpServerName+ "String_Node_Str"+ ftpServerPort+ "String_Node_Str"+ ftpUserName+ "String_Node_Str"+ ftpUserPassword.replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ getFtpErrorMessage();
        log.warn(message);
        throw new IOFailure(message);
      }
      if (!currentFTPClient.setFileType(FTPClient.BINARY_FILE_TYPE)) {
        final String message="String_Node_Str" + ftpServerName + "String_Node_Str"+ getFtpErrorMessage();
        log.warn(message);
        throw new IOFailure(message);
      }
      currentFTPClient.enterLocalPassiveMode();
      log.debug("String_Node_Str" + currentFTPClient.getDefaultTimeout());
      logOnSuccessful=true;
    }
 catch (    IOException e) {
      final String msg="String_Node_Str" + ftpServerName + "String_Node_Str"+ SystemUtils.getLocalHostName()+ "String_Node_Str";
      if (tries < FTP_RETRIES) {
        log.debug(msg + "String_Node_Str" + tries+ "String_Node_Str"+ FTP_RETRIES+ "String_Node_Str"+ "String_Node_Str",e);
        TimeUtils.exponentialBackoffSleep(tries,Calendar.MINUTE);
      }
 else {
        log.warn(msg + "String_Node_Str" + tries+ "String_Node_Str");
        throw new IOFailure(msg,e);
      }
    }
  }
  log.debug("String_Node_Str" + ftpUserName + "String_Node_Str"+ ftpUserPassword.replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ ftpServerName+ "String_Node_Str"+ ftpServerPort);
}