Program: 44803
Project: 44803
Buggy source:
/** 
 * Updates the current list of players for a given server.
 * @param key the server key.
 * @param list the list of currently logged in players.
 * @since 0.1
 */
@Deprecated public void updateConnect(String key,List<PlayerInfo> 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 (    PlayerInfo info : list) {
      String playerKey="String_Node_Str" + key + info.getGuid();
      Player player=playerDAO.findByServerAndGuid(server.getKey(),info.getGuid());
      Date playerLastUpdate=null;
      if (player == null) {
        player=new Player();
        player.setCreated(stamp);
        player.setGuid(info.getGuid());
        player.setServer(server.getKey());
        player.setBanInfo(null);
        player.setBanInfoUpdated(null);
        if (info.getUpdated() != null) {
          player.setUpdated(info.getUpdated());
        }
 else {
          player.setUpdated(stamp);
        }
        playerDAO.save(player);
      }
 else {
        if (player.getBanInfo() != null) {
          player.setBanInfo(null);
          player.setBanInfoUpdated(null);
        }
        playerLastUpdate=player.getUpdated();
        player.setUpdated(stamp);
        playerDAO.save(player,false);
        entities.put(playerKey,player.toEntity());
      }
      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());
        alias.setServer(server.getKey());
        if (info.getUpdated() != null) {
          alias.setUpdated(info.getUpdated());
        }
 else {
          alias.setUpdated(stamp);
        }
      }
 else {
        if (server.getUpdated() == null || playerLastUpdate == null || server.getUpdated().after(playerLastUpdate)) {
          alias.setCount(alias.getCount() + 1);
        }
        alias.setUpdated(stamp);
        aliasDAO.save(alias,false);
      }
      entities.put(aliasKey,alias.toEntity());
    }
    server.setUpdated(stamp);
    service.put(entities.values());
    serverDAO.save(server);
  }
 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):
/** 
 * Updates the current list of players for a given server.
 * @param key the server key.
 * @param list the list of currently logged in players.
 * @since 0.1
 */
@Deprecated public void updateConnect(String key,List<PlayerInfo> 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 (    PlayerInfo info : list) {
      String playerKey="String_Node_Str" + key + info.getGuid();
      Player player=playerDAO.findByServerAndGuid(server.getKey(),info.getGuid());
      Date playerLastUpdate=null;
      if (player == null) {
        player=new Player();
        player.setCreated(stamp);
        player.setGuid(info.getGuid());
        player.setServer(server.getKey());
        player.setBanInfo(null);
        player.setBanInfoUpdated(null);
        if (info.getUpdated() != null) {
          player.setUpdated(info.getUpdated());
        }
 else {
          player.setUpdated(stamp);
        }
        playerDAO.save(player);
      }
 else {
        if (player.getBanInfo() != null) {
          player.setBanInfo(null);
          player.setBanInfoUpdated(null);
        }
        playerLastUpdate=player.getUpdated();
        player.setUpdated(stamp);
        playerDAO.save(player,false);
        entities.put(playerKey,player.toEntity());
      }
      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());
        alias.setServer(server.getKey());
        if (info.getUpdated() != null) {
          alias.setUpdated(info.getUpdated());
        }
 else {
          alias.setUpdated(stamp);
        }
      }
 else {
        if (server.getUpdated() == null || playerLastUpdate == null || server.getUpdated().after(playerLastUpdate)) {
          alias.setCount(alias.getCount() + 1);
        }
        alias.setUpdated(stamp);
        aliasDAO.save(alias,false);
      }
      entities.put(aliasKey,alias.toEntity());
    }
    server.setUpdated(stamp);
    service.put(entities.values());
    serverDAO.save(server);
  }
 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());
  }
}