Program: 152272
Project: 152272
Buggy source:
/** 
 * Get the user object. Fetch the row from the table.
 */
public synchronized User getUserByName(String name) throws FtpException {
  lazyInit();
  Statement stmt=null;
  ResultSet rs=null;
  try {
    HashMap<String,Object> map=new HashMap<String,Object>();
    map.put(ATTR_LOGIN,escapeString(name));
    String sql=StringUtils.replaceString(selectUserStmt,map);
    LOG.info(sql);
    stmt=createConnection().createStatement();
    rs=stmt.executeQuery(sql);
    BaseUser thisUser=null;
    String trueStr=Boolean.TRUE.toString();
    if (rs.next()) {
      thisUser=new BaseUser();
      thisUser.setName(rs.getString(ATTR_LOGIN));
      thisUser.setHomeDirectory(rs.getString(ATTR_HOME));
      thisUser.setEnabled(trueStr.equalsIgnoreCase(rs.getString(ATTR_ENABLE)));
      thisUser.setMaxIdleTime(rs.getInt(ATTR_MAX_IDLE_TIME));
      List<Authority> authorities=new ArrayList<Authority>();
      if (trueStr.equalsIgnoreCase(rs.getString(ATTR_WRITE_PERM))) {
        authorities.add(new WritePermission());
      }
      authorities.add(new ConcurrentLoginPermission(rs.getInt(ATTR_MAX_LOGIN_NUMBER),rs.getInt(ATTR_MAX_LOGIN_PER_IP)));
      authorities.add(new TransferRatePermission(rs.getInt(ATTR_MAX_DOWNLOAD_RATE),rs.getInt(ATTR_MAX_UPLOAD_RATE)));
      thisUser.setAuthorities(authorities.toArray(new Authority[0]));
    }
    return thisUser;
  }
 catch (  SQLException ex) {
    LOG.error("String_Node_Str",ex);
    throw new FtpException("String_Node_Str",ex);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str",ex);
      }
    }
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str",ex);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Get the user object. Fetch the row from the table.
 */
public synchronized User getUserByName(String name) throws FtpException {
  lazyInit();
  Statement stmt=null;
  ResultSet rs=null;
  try {
    HashMap<String,Object> map=new HashMap<String,Object>();
    map.put(ATTR_LOGIN,escapeString(name));
    String sql=StringUtils.replaceString(selectUserStmt,map);
    LOG.info(sql);
    stmt=createConnection().createStatement();
    rs=stmt.executeQuery(sql);
    BaseUser thisUser=null;
    if (rs.next()) {
      thisUser=new BaseUser();
      thisUser.setName(rs.getString(ATTR_LOGIN));
      thisUser.setHomeDirectory(rs.getString(ATTR_HOME));
      thisUser.setEnabled(isTrue(rs.getString(ATTR_ENABLE)));
      thisUser.setMaxIdleTime(rs.getInt(ATTR_MAX_IDLE_TIME));
      List<Authority> authorities=new ArrayList<Authority>();
      if (isTrue(rs.getString(ATTR_WRITE_PERM))) {
        authorities.add(new WritePermission());
      }
      authorities.add(new ConcurrentLoginPermission(rs.getInt(ATTR_MAX_LOGIN_NUMBER),rs.getInt(ATTR_MAX_LOGIN_PER_IP)));
      authorities.add(new TransferRatePermission(rs.getInt(ATTR_MAX_DOWNLOAD_RATE),rs.getInt(ATTR_MAX_UPLOAD_RATE)));
      thisUser.setAuthorities(authorities.toArray(new Authority[0]));
    }
    return thisUser;
  }
 catch (  SQLException ex) {
    LOG.error("String_Node_Str",ex);
    throw new FtpException("String_Node_Str",ex);
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str",ex);
      }
    }
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      Exception ex) {
        LOG.error("String_Node_Str",ex);
      }
    }
  }
}