Program: 152340
Project: 152340
Buggy source:
/** 
 * Execute command.
 */
public void execute(RequestHandler handler,FtpRequestImpl request,FtpWriter out) throws IOException, FtpException {
  try {
    request.resetState();
    IFtpConfig fconfig=handler.getConfig();
    Ftplet ftpletContainer=fconfig.getFtpletContainer();
    FtpletEnum ftpletRet=ftpletContainer.onUploadUniqueStart(request,out);
    if (ftpletRet == FtpletEnum.RET_SKIP) {
      return;
    }
 else     if (ftpletRet == FtpletEnum.RET_DISCONNECT) {
      fconfig.getConnectionManager().closeConnection(handler);
      return;
    }
    FileObject file=null;
    try {
      file=request.getFileSystemView().getFileObject("String_Node_Str");
      if (file != null) {
        file=getUniqueFile(handler,file);
      }
    }
 catch (    Exception ex) {
    }
    if (file == null) {
      out.send(550,"String_Node_Str",null);
      return;
    }
    String fileName=file.getFullName();
    if (!file.hasWritePermission()) {
      out.send(550,"String_Node_Str",fileName);
      return;
    }
    out.send(150,"String_Node_Str",null);
    InputStream is=null;
    try {
      is=request.getDataInputStream();
    }
 catch (    IOException ex) {
      out.send(425,"String_Node_Str",fileName);
      return;
    }
    boolean failure=false;
    BufferedInputStream bis=null;
    BufferedOutputStream bos=null;
    out.send(250,"String_Node_Str",fileName);
    try {
      bis=IoUtils.getBufferedInputStream(is);
      bos=IoUtils.getBufferedOutputStream(file.createOutputStream(false));
      int maxRate=handler.getRequest().getUser().getMaxUploadRate();
      long transSz=handler.transfer(bis,bos,maxRate);
      String userName=request.getUser().getName();
      Log log=fconfig.getLogFactory().getInstance(getClass());
      log.info("String_Node_Str" + userName + "String_Node_Str"+ fileName);
      IFtpStatistics ftpStat=(IFtpStatistics)fconfig.getFtpStatistics();
      ftpStat.setUpload(handler,file,transSz);
    }
 catch (    SocketException ex) {
      failure=true;
      out.send(426,"String_Node_Str",fileName);
    }
catch (    IOException ex) {
      failure=true;
      out.send(551,"String_Node_Str",fileName);
    }
 finally {
      IoUtils.close(bis);
      IoUtils.close(bos);
    }
    if (!failure) {
      out.send(226,"String_Node_Str",fileName);
      ftpletRet=ftpletContainer.onUploadUniqueEnd(request,out);
      if (ftpletRet == FtpletEnum.RET_DISCONNECT) {
        fconfig.getConnectionManager().closeConnection(handler);
        return;
      }
    }
  }
  finally {
    request.getFtpDataConnection().closeDataSocket();
  }
}

Fixed version (ground truth):
/** 
 * Execute command.
 */
public void execute(RequestHandler handler,FtpRequestImpl request,FtpWriter out) throws IOException, FtpException {
  try {
    request.resetState();
    IFtpConfig fconfig=handler.getConfig();
    Ftplet ftpletContainer=fconfig.getFtpletContainer();
    FtpletEnum ftpletRet=ftpletContainer.onUploadUniqueStart(request,out);
    if (ftpletRet == FtpletEnum.RET_SKIP) {
      return;
    }
 else     if (ftpletRet == FtpletEnum.RET_DISCONNECT) {
      fconfig.getConnectionManager().closeConnection(handler);
      return;
    }
    FileObject file=null;
    try {
      file=request.getFileSystemView().getFileObject("String_Node_Str");
      if (file != null) {
        file=getUniqueFile(handler,file);
      }
    }
 catch (    Exception ex) {
    }
    if (file == null) {
      out.send(550,"String_Node_Str",null);
      return;
    }
    String fileName=file.getFullName();
    if (!file.hasWritePermission()) {
      out.send(550,"String_Node_Str",fileName);
      return;
    }
    out.send(150,"String_Node_Str",null);
    InputStream is=null;
    try {
      is=request.getDataInputStream();
    }
 catch (    IOException ex) {
      out.send(425,"String_Node_Str",fileName);
      return;
    }
    boolean failure=false;
    BufferedInputStream bis=null;
    BufferedOutputStream bos=null;
    out.send(250,"String_Node_Str",fileName);
    try {
      bis=IoUtils.getBufferedInputStream(is);
      bos=IoUtils.getBufferedOutputStream(file.createOutputStream(0L));
      int maxRate=handler.getRequest().getUser().getMaxUploadRate();
      long transSz=handler.transfer(bis,bos,maxRate);
      String userName=request.getUser().getName();
      Log log=fconfig.getLogFactory().getInstance(getClass());
      log.info("String_Node_Str" + userName + "String_Node_Str"+ fileName);
      IFtpStatistics ftpStat=(IFtpStatistics)fconfig.getFtpStatistics();
      ftpStat.setUpload(handler,file,transSz);
    }
 catch (    SocketException ex) {
      failure=true;
      out.send(426,"String_Node_Str",fileName);
    }
catch (    IOException ex) {
      failure=true;
      out.send(551,"String_Node_Str",fileName);
    }
 finally {
      IoUtils.close(bis);
      IoUtils.close(bos);
    }
    if (!failure) {
      out.send(226,"String_Node_Str",fileName);
      ftpletRet=ftpletContainer.onUploadUniqueEnd(request,out);
      if (ftpletRet == FtpletEnum.RET_DISCONNECT) {
        fconfig.getConnectionManager().closeConnection(handler);
        return;
      }
    }
  }
  finally {
    request.getFtpDataConnection().closeDataSocket();
  }
}