Program: 152233
Project: 152233
Buggy source:
public void messageReceived(final FtpIoSession session,final FtpRequest request) throws Exception {
  try {
    session.updateLastAccessTime();
    String commandName=request.getCommand();
    CommandFactory commandFactory=context.getCommandFactory();
    Command command=commandFactory.getCommand(commandName);
    if (!session.isLoggedIn() && !isCommandOkWithoutAuthentication(commandName)) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_530_NOT_LOGGED_IN,"String_Node_Str",null));
      return;
    }
    FtpletContainer ftplets=context.getFtpletContainer();
    FtpletResult ftpletRet;
    try {
      ftpletRet=ftplets.beforeCommand(session.getFtpletSession(),request);
    }
 catch (    Exception e) {
      LOG.debug("String_Node_Str",e);
      ftpletRet=FtpletResult.DISCONNECT;
    }
    if (ftpletRet == FtpletResult.DISCONNECT) {
      session.close(false).awaitUninterruptibly(10000);
      return;
    }
 else     if (ftpletRet != FtpletResult.SKIP) {
      if (command != null) {
synchronized (session) {
          command.execute(session,context,request);
        }
      }
 else {
        session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED,"String_Node_Str",null));
      }
      try {
        ftpletRet=ftplets.afterCommand(session.getFtpletSession(),request,session.getLastReply());
      }
 catch (      Exception e) {
        LOG.debug("String_Node_Str",e);
        ftpletRet=FtpletResult.DISCONNECT;
      }
      if (ftpletRet == FtpletResult.DISCONNECT) {
        session.close(false).awaitUninterruptibly(10000);
        return;
      }
    }
  }
 catch (  Exception ex) {
    try {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN,null,null));
    }
 catch (    Exception ex1) {
    }
    if (ex instanceof java.io.IOException) {
      throw (IOException)ex;
    }
 else {
      LOG.warn("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
public void messageReceived(final FtpIoSession session,final FtpRequest request) throws Exception {
  try {
    session.updateLastAccessTime();
    String commandName=request.getCommand();
    CommandFactory commandFactory=context.getCommandFactory();
    Command command=commandFactory.getCommand(commandName);
    if (!session.isLoggedIn() && !isCommandOkWithoutAuthentication(commandName)) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_530_NOT_LOGGED_IN,"String_Node_Str",null));
      return;
    }
    FtpletContainer ftplets=context.getFtpletContainer();
    FtpletResult ftpletRet;
    try {
      ftpletRet=ftplets.beforeCommand(session.getFtpletSession(),request);
    }
 catch (    Exception e) {
      LOG.debug("String_Node_Str",e);
      ftpletRet=FtpletResult.DISCONNECT;
    }
    if (ftpletRet == FtpletResult.DISCONNECT) {
      LOG.debug("String_Node_Str");
      session.close(false).awaitUninterruptibly(10000);
      return;
    }
 else     if (ftpletRet != FtpletResult.SKIP) {
      if (command != null) {
synchronized (session) {
          command.execute(session,context,request);
        }
      }
 else {
        session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED,"String_Node_Str",null));
      }
      try {
        ftpletRet=ftplets.afterCommand(session.getFtpletSession(),request,session.getLastReply());
      }
 catch (      Exception e) {
        LOG.debug("String_Node_Str",e);
        ftpletRet=FtpletResult.DISCONNECT;
      }
      if (ftpletRet == FtpletResult.DISCONNECT) {
        LOG.debug("String_Node_Str");
        session.close(false).awaitUninterruptibly(10000);
        return;
      }
    }
  }
 catch (  Exception ex) {
    try {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN,null,null));
    }
 catch (    Exception ex1) {
    }
    if (ex instanceof java.io.IOException) {
      throw (IOException)ex;
    }
 else {
      LOG.warn("String_Node_Str",ex);
    }
  }
}