Program: 44804
Project: 44804
Buggy source:
/** 
 * Bulk updates banning information for the given players.
 * @param key the server uid.
 * @param list the ban information list. If  {@link BanInfo#getReason()} isnull or empty, stores <code>null</code> y the datastore. That's in order to unban a player.
 * @since 0.1
 */
@Deprecated public void updateBanInfo(String key,List<BanInfo> list,String remoteAddr){
  DatastoreService service=DatastoreServiceFactory.getDatastoreService();
  ServerManager serverManager=new ServerManager();
  try {
    Date stamp=new Date();
    Server server=serverManager.getAuthorizedServer(key,remoteAddr);
    log.info("String_Node_Str" + server.getName());
    Map<String,Entity> entities=new HashMap<String,Entity>();
    for (    BanInfo info : list) {
      Player player=playerDAO.findByServerAndGuid(server.getKey(),info.getGuid());
      String reason=info.getReason();
      Date banInfoUpdated=info.getUpdated() != null ? info.getUpdated() : new Date();
      if (StringUtils.isEmpty(reason))       reason=null;
      if (player == null) {
        player=new Player();
        player.setCreated(stamp);
        player.setGuid(info.getGuid());
        player.setServer(server.getKey());
        if (info.getUpdated() != null)         player.setUpdated(info.getUpdated());
        player.setBanInfo(reason);
        player.setBanInfoUpdated(reason != null ? banInfoUpdated : null);
        playerDAO.save(player);
      }
 else {
        if (info.getUpdated() != null)         player.setUpdated(info.getUpdated());
        player.setBanInfo(reason);
        player.setBanInfoUpdated(reason != null ? banInfoUpdated : null);
        entities.put("String_Node_Str" + player.getGuid(),player.toEntity());
        playerDAO.save(player,false);
      }
      String aliasKey="String_Node_Str" + player.getGuid() + info.getName()+ info.getIp();
      Alias alias=aliasDAO.findByPlayerAndNicknameAndIp(player.getKey(),info.getName(),info.getIp());
      if (alias == null) {
        alias=new Alias();
        alias.setCount(1L);
        alias.setCreated(stamp);
        alias.setNickname(info.getName());
        alias.setNgrams(NGrams.ngrams(info.getName()));
        alias.setPlayer(player.getKey());
        alias.setIp(info.getIp());
        if (info.getUpdated() != null) {
          alias.setUpdated(info.getUpdated());
        }
        alias.setServer(server.getKey());
        entities.put(aliasKey,alias.toEntity());
      }
 else {
        if (info.getUpdated() != null) {
          alias.setUpdated(info.getUpdated());
          entities.put(aliasKey,alias.toEntity());
        }
        aliasDAO.save(alias,false);
      }
    }
    service.put(entities.values());
  }
 catch (  UnauthorizedUpdateException e) {
    log.severe(e.getMessage());
    StringWriter w=new StringWriter();
    e.printStackTrace(new PrintWriter(w));
    log.severe(w.getBuffer().toString());
  }
catch (  Exception e) {
    log.severe(e.getMessage());
    StringWriter w=new StringWriter();
    e.printStackTrace(new PrintWriter(w));
    log.severe(w.getBuffer().toString());
  }
}

Fixed version (ground truth):
/** 
 * Bulk updates banning information for the given players.
 * @param key the server uid.
 * @param list the ban information list. If  {@link BanInfo#getReason()} isnull or empty, stores <code>null</code> y the datastore. That's in order to unban a player.
 * @since 0.1
 */
@Deprecated public void updateBanInfo(String key,List<BanInfo> list,String remoteAddr){
  DatastoreService service=DatastoreServiceFactory.getDatastoreService();
  ServerManager serverManager=new ServerManager();
  try {
    Date stamp=new Date();
    Server server=serverManager.getAuthorizedServer(key,remoteAddr);
    log.info("String_Node_Str" + server.getName());
    Map<String,Entity> entities=new LinkedHashMap<String,Entity>();
    for (    BanInfo info : list) {
      Player player=playerDAO.findByServerAndGuid(server.getKey(),info.getGuid());
      String reason=info.getReason();
      Date banInfoUpdated=info.getUpdated() != null ? info.getUpdated() : new Date();
      if (StringUtils.isEmpty(reason))       reason=null;
      if (player == null) {
        player=new Player();
        player.setCreated(stamp);
        player.setGuid(info.getGuid());
        player.setServer(server.getKey());
        if (info.getUpdated() != null)         player.setUpdated(info.getUpdated());
        player.setBanInfo(reason);
        player.setBanInfoUpdated(reason != null ? banInfoUpdated : null);
        playerDAO.save(player);
      }
 else {
        if (info.getUpdated() != null)         player.setUpdated(info.getUpdated());
        player.setBanInfo(reason);
        player.setBanInfoUpdated(reason != null ? banInfoUpdated : null);
        entities.put("String_Node_Str" + player.getGuid(),player.toEntity());
        playerDAO.save(player,false);
      }
      String aliasKey="String_Node_Str" + player.getGuid() + info.getName()+ info.getIp();
      Alias alias=aliasDAO.findByPlayerAndNicknameAndIp(player.getKey(),info.getName(),info.getIp());
      if (alias == null) {
        alias=new Alias();
        alias.setCount(1L);
        alias.setCreated(stamp);
        alias.setNickname(info.getName());
        alias.setNgrams(NGrams.ngrams(info.getName()));
        alias.setPlayer(player.getKey());
        alias.setIp(info.getIp());
        if (info.getUpdated() != null) {
          alias.setUpdated(info.getUpdated());
        }
        alias.setServer(server.getKey());
        entities.put(aliasKey,alias.toEntity());
      }
 else {
        if (info.getUpdated() != null) {
          alias.setUpdated(info.getUpdated());
          entities.put(aliasKey,alias.toEntity());
        }
        aliasDAO.save(alias,false);
      }
    }
    service.put(entities.values());
  }
 catch (  UnauthorizedUpdateException e) {
    log.severe(e.getMessage());
    StringWriter w=new StringWriter();
    e.printStackTrace(new PrintWriter(w));
    log.severe(w.getBuffer().toString());
  }
catch (  Exception e) {
    log.severe(e.getMessage());
    StringWriter w=new StringWriter();
    e.printStackTrace(new PrintWriter(w));
    log.severe(w.getBuffer().toString());
  }
}