Program: 86648
Project: 86648
Buggy source:
/** 
 * Given the game state, retrieve the   {@link Entity}'s in the current entities view.
 * @param game
 * @return a list of {@link Entity}s that are in this players view
 */
public List<Entity> getEntitiesInView(Game game,List<Entity> entitiesInView){
  Map map=game.getMap();
  Entity[] entities=game.getEntities();
  Vector2f centerPos=getCenterPos();
  this.visualBounds.centerAround(centerPos);
  if (isOperatingVehicle()) {
    getVehicle().calculateLineOfSight(game.tilesInLineOfSight);
  }
 else {
    calculateLineOfSight(game.tilesInLineOfSight);
  }
  for (int i=0; i < entities.length; i++) {
    Entity ent=entities[i];
    if (ent == null) {
      continue;
    }
    Type entType=ent.getType();
    boolean isCalculatedEntity=entType == Type.PLAYER;
    if (isCalculatedEntity && game.isEnableFOW()) {
      if (ent.getId() != id) {
        Vector2f pos=ent.getCenterPos();
        Vector2f.Vector2fSubtract(pos,centerPos,this.enemyDir);
        Vector2f.Vector2fNormalize(this.enemyDir,this.enemyDir);
        if (!game.isEntityReachable(ent,centerPos,this.enemyDir)) {
          continue;
        }
        int px=(int)pos.x;
        int py=(int)pos.y;
        Tile tile=map.getWorldTile(0,px,py);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        int width=ent.getBounds().width;
        int height=ent.getBounds().height;
        px=(int)ent.getPos().x;
        py=(int)ent.getPos().y;
        tile=map.getWorldTile(0,px + width,py);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        tile=map.getWorldTile(0,px + width,py + height);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        tile=map.getWorldTile(0,px,py + height);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        tile=map.getWorldTile(0,px,py);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
      }
    }
 else {
      Type type=ent.getType();
switch (type) {
case BOMB:
        Bomb bomb=(Bomb)ent;
      if (bomb.isPlanted()) {
        entitiesInView.add(ent);
      }
    break;
case LIGHT_BULB:
case BOMB_TARGET:
  break;
default :
{
  if (visualBounds.intersects(ent.getBounds())) {
    entitiesInView.add(ent);
  }
}
}
}
}
pruneEntitiesBehindSmoke(entitiesInView);
return entitiesInView;
}

Fixed version (ground truth):
/** 
 * Given the game state, retrieve the   {@link Entity}'s in the current entities view.
 * @param game
 * @return a list of {@link Entity}s that are in this players view
 */
public List<Entity> getEntitiesInView(Game game,List<Entity> entitiesInView){
  Map map=game.getMap();
  Entity[] entities=game.getEntities();
  Vector2f centerPos=getCenterPos();
  this.visualBounds.centerAround(centerPos);
  if (isOperatingVehicle()) {
    getVehicle().calculateLineOfSight(game.tilesInLineOfSight);
  }
 else {
    calculateLineOfSight(game.tilesInLineOfSight);
  }
  for (int i=0; i < entities.length; i++) {
    Entity ent=entities[i];
    if (ent == null) {
      continue;
    }
    Type entType=ent.getType();
    boolean isCalculatedEntity=entType == Type.PLAYER;
    if (isCalculatedEntity && game.isEnableFOW()) {
      if (ent.getId() != id) {
        Vector2f pos=ent.getCenterPos();
        Vector2f.Vector2fSubtract(pos,centerPos,this.enemyDir);
        Vector2f.Vector2fNormalize(this.enemyDir,this.enemyDir);
        if (!game.isEntityReachable(ent,centerPos,this.enemyDir)) {
          continue;
        }
        int px=(int)pos.x;
        int py=(int)pos.y;
        Tile tile=map.getWorldTile(0,px,py);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        int width=ent.getBounds().width;
        int height=ent.getBounds().height;
        px=(int)ent.getPos().x;
        py=(int)ent.getPos().y;
        tile=map.getWorldTile(0,px + width,py);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        tile=map.getWorldTile(0,px + width,py + height);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        tile=map.getWorldTile(0,px,py + height);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
        tile=map.getWorldTile(0,px,py);
        if (tile != null) {
          if (tile.getMask() > 0) {
            entitiesInView.add(ent);
            continue;
          }
        }
      }
    }
 else {
      Type type=ent.getType();
switch (type) {
case BOMB:
        Bomb bomb=(Bomb)ent;
      if (bomb.isPlanted()) {
        entitiesInView.add(ent);
      }
    break;
case LIGHT_BULB:
case BOMB_TARGET:
default :
{
    if (visualBounds.intersects(ent.getBounds())) {
      entitiesInView.add(ent);
    }
  }
}
}
}
pruneEntitiesBehindSmoke(entitiesInView);
return entitiesInView;
}