Program: 152232
Project: 152232
Buggy source:
/** 
 * Execute command.
 */
public void execute(final FtpIoSession session,final FtpServerContext context,final FtpRequest request) throws IOException, FtpException {
  boolean success=false;
  ServerFtpStatistics stat=(ServerFtpStatistics)context.getFtpStatistics();
  try {
    session.resetState();
    String userName=request.getArgument();
    if (userName == null) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,"String_Node_Str",null));
      return;
    }
    MdcInjectionFilter.setProperty(session,"String_Node_Str",userName);
    User user=session.getUser();
    if (session.isLoggedIn()) {
      if (userName.equals(user.getName())) {
        session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_230_USER_LOGGED_IN,"String_Node_Str",null));
        success=true;
      }
 else {
        session.write(LocalizedFtpReply.translate(session,request,context,530,"String_Node_Str",null));
      }
      return;
    }
    boolean anonymous=userName.equals("String_Node_Str");
    if (anonymous && (!context.getConnectionConfig().isAnonymousLoginEnabled())) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_530_NOT_LOGGED_IN,"String_Node_Str",null));
      return;
    }
    int currAnonLogin=stat.getCurrentAnonymousLoginNumber();
    int maxAnonLogin=context.getConnectionConfig().getMaxAnonymousLogins();
    if (anonymous && (currAnonLogin >= maxAnonLogin)) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
      return;
    }
    int currLogin=stat.getCurrentLoginNumber();
    int maxLogin=context.getConnectionConfig().getMaxLogins();
    if (maxLogin != 0 && currLogin >= maxLogin) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
      return;
    }
    User configUser=context.getUserManager().getUserByName(userName);
    if (configUser != null) {
      InetAddress address=null;
      if (session.getRemoteAddress() instanceof InetSocketAddress) {
        address=((InetSocketAddress)session.getRemoteAddress()).getAddress();
      }
      ConcurrentLoginRequest loginRequest=new ConcurrentLoginRequest(stat.getCurrentUserLoginNumber(configUser) + 1,stat.getCurrentUserLoginNumber(configUser,address) + 1);
      if (configUser.authorize(loginRequest) == null) {
        session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
        return;
      }
    }
    success=true;
    session.setUserArgument(userName);
    if (anonymous) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD,"String_Node_Str",userName));
    }
 else {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD,"String_Node_Str",userName));
    }
  }
  finally {
    if (!success) {
      session.close(false).awaitUninterruptibly(10000);
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute command.
 */
public void execute(final FtpIoSession session,final FtpServerContext context,final FtpRequest request) throws IOException, FtpException {
  boolean success=false;
  ServerFtpStatistics stat=(ServerFtpStatistics)context.getFtpStatistics();
  try {
    session.resetState();
    String userName=request.getArgument();
    if (userName == null) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,"String_Node_Str",null));
      return;
    }
    MdcInjectionFilter.setProperty(session,"String_Node_Str",userName);
    User user=session.getUser();
    if (session.isLoggedIn()) {
      if (userName.equals(user.getName())) {
        session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_230_USER_LOGGED_IN,"String_Node_Str",null));
        success=true;
      }
 else {
        session.write(LocalizedFtpReply.translate(session,request,context,530,"String_Node_Str",null));
      }
      return;
    }
    boolean anonymous=userName.equals("String_Node_Str");
    if (anonymous && (!context.getConnectionConfig().isAnonymousLoginEnabled())) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_530_NOT_LOGGED_IN,"String_Node_Str",null));
      return;
    }
    int currAnonLogin=stat.getCurrentAnonymousLoginNumber();
    int maxAnonLogin=context.getConnectionConfig().getMaxAnonymousLogins();
    if (maxAnonLogin == 0) {
      LOG.debug("String_Node_Str",currAnonLogin);
    }
 else {
      LOG.debug("String_Node_Str",currAnonLogin,maxAnonLogin);
    }
    if (anonymous && (currAnonLogin >= maxAnonLogin)) {
      LOG.debug("String_Node_Str");
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
      return;
    }
    int currLogin=stat.getCurrentLoginNumber();
    int maxLogin=context.getConnectionConfig().getMaxLogins();
    if (maxLogin == 0) {
      LOG.debug("String_Node_Str",currLogin);
    }
 else {
      LOG.debug("String_Node_Str",currLogin,maxLogin);
    }
    if (maxLogin != 0 && currLogin >= maxLogin) {
      LOG.debug("String_Node_Str");
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
      return;
    }
    User configUser=context.getUserManager().getUserByName(userName);
    if (configUser != null) {
      InetAddress address=null;
      if (session.getRemoteAddress() instanceof InetSocketAddress) {
        address=((InetSocketAddress)session.getRemoteAddress()).getAddress();
      }
      ConcurrentLoginRequest loginRequest=new ConcurrentLoginRequest(stat.getCurrentUserLoginNumber(configUser) + 1,stat.getCurrentUserLoginNumber(configUser,address) + 1);
      if (configUser.authorize(loginRequest) == null) {
        LOG.debug("String_Node_Str");
        session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION,"String_Node_Str",null));
        return;
      }
    }
    success=true;
    session.setUserArgument(userName);
    if (anonymous) {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD,"String_Node_Str",userName));
    }
 else {
      session.write(LocalizedFtpReply.translate(session,request,context,FtpReply.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD,"String_Node_Str",userName));
    }
  }
  finally {
    if (!success) {
      LOG.debug("String_Node_Str");
      session.close(false).awaitUninterruptibly(10000);
    }
  }
}