Program: 173460
Project: 173460
Buggy source:
private void generateMapGraph(GameManager gameManager){
  MapManager mapManager=gameManager.getMapManager();
  RevenueManager revenueManager=gameManager.getRevenueManager();
  for (  MapHex hex : mapManager.getHexes()) {
    Tile tile=hex.getCurrentTile();
    Collection<Station> stations=tile.getStations();
    for (    Station station : stations) {
      NetworkVertex stationVertex=new NetworkVertex(hex,station);
      graph.addVertex(stationVertex);
      vertices.put(stationVertex.getIdentifier(),stationVertex);
      log.info("String_Node_Str" + stationVertex);
    }
    for (    HexSide side : HexSide.all())     if (tile.hasTracks(side)) {
      HexSide rotated=side.rotate(hex.getCurrentTileRotation());
      NetworkVertex sideVertex=new NetworkVertex(hex,rotated);
      graph.addVertex(sideVertex);
      vertices.put(sideVertex.getIdentifier(),sideVertex);
      log.info("String_Node_Str" + sideVertex);
    }
  }
  for (  MapHex hex : mapManager.getHexes()) {
    Tile tile=hex.getCurrentTile();
    Set<Track> tracks=tile.getTracks();
    for (    Track track : tracks) {
      NetworkVertex startVertex=getVertexRotated(hex,track.getStart());
      NetworkVertex endVertex=getVertexRotated(hex,track.getEnd());
      log.info("String_Node_Str" + track);
      NetworkEdge edge=new NetworkEdge(startVertex,endVertex,false);
      if (startVertex == endVertex) {
        log.error("String_Node_Str" + track + "String_Node_Str"+ hex+ "String_Node_Str");
      }
 else {
        graph.addEdge(startVertex,endVertex,edge);
        log.info("String_Node_Str" + edge.getConnection());
      }
    }
    for (    HexSide side : HexSide.head()) {
      MapHex neighborHex=mapManager.getNeighbour(hex,side);
      if (neighborHex == null) {
        log.info("String_Node_Str" + hex.getId() + "String_Node_Str"+ hex.getOrientationName(side)+ "String_Node_Str");
        continue;
      }
      NetworkVertex vertex=getVertex(hex,side);
      HexSide rotated=side.opposite();
      NetworkVertex otherVertex=getVertex(neighborHex,rotated);
      if (vertex == null && otherVertex == null) {
        log.info("String_Node_Str" + hex.getId() + "String_Node_Str"+ hex.getOrientationName(side));
        log.info("String_Node_Str" + neighborHex.getId() + "String_Node_Str"+ neighborHex.getOrientationName(rotated));
        continue;
      }
 else       if (vertex == null && otherVertex != null) {
        log.info("String_Node_Str" + neighborHex.getId() + "String_Node_Str"+ neighborHex.getOrientationName(rotated)+ "String_Node_Str"+ hex.getId()+ "String_Node_Str"+ hex.getOrientationName(side));
        vertex=new NetworkVertex(hex,side);
        graph.addVertex(vertex);
        vertices.put(vertex.getIdentifier(),vertex);
        log.info("String_Node_Str" + vertex);
      }
 else       if (otherVertex == null) {
        log.info("String_Node_Str" + hex.getId() + "String_Node_Str"+ hex.getOrientationName(side)+ "String_Node_Str"+ neighborHex.getId()+ "String_Node_Str"+ neighborHex.getOrientationName(rotated));
        otherVertex=new NetworkVertex(neighborHex,rotated);
        graph.addVertex(otherVertex);
        vertices.put(otherVertex.getIdentifier(),otherVertex);
        log.info("String_Node_Str" + otherVertex);
      }
      NetworkEdge edge=new NetworkEdge(vertex,otherVertex,true);
      graph.addEdge(vertex,otherVertex,edge);
      log.info("String_Node_Str" + edge.getConnection());
    }
  }
  if (revenueManager != null) {
    revenueManager.initGraphModifiers(this);
  }
}

Fixed version (ground truth):
private void generateMapGraph(RailsRoot root){
  MapManager mapManager=root.getMapManager();
  RevenueManager revenueManager=root.getRevenueManager();
  for (  MapHex hex : mapManager.getHexes()) {
    Tile tile=hex.getCurrentTile();
    Collection<Station> stations=tile.getStations();
    for (    Station station : stations) {
      NetworkVertex stationVertex=new NetworkVertex(hex,station);
      graph.addVertex(stationVertex);
      vertices.put(stationVertex.getIdentifier(),stationVertex);
      log.info("String_Node_Str" + stationVertex);
    }
    for (    HexSide side : HexSide.all())     if (tile.hasTracks(side)) {
      HexSide rotated=side.rotate(hex.getCurrentTileRotation());
      NetworkVertex sideVertex=new NetworkVertex(hex,rotated);
      graph.addVertex(sideVertex);
      vertices.put(sideVertex.getIdentifier(),sideVertex);
      log.info("String_Node_Str" + sideVertex);
    }
  }
  for (  MapHex hex : mapManager.getHexes()) {
    Tile tile=hex.getCurrentTile();
    Set<Track> tracks=tile.getTracks();
    for (    Track track : tracks) {
      NetworkVertex startVertex=getVertexRotated(hex,track.getStart());
      NetworkVertex endVertex=getVertexRotated(hex,track.getEnd());
      log.info("String_Node_Str" + track);
      NetworkEdge edge=new NetworkEdge(startVertex,endVertex,false);
      if (startVertex == endVertex) {
        log.error("String_Node_Str" + track + "String_Node_Str"+ hex+ "String_Node_Str");
      }
 else {
        graph.addEdge(startVertex,endVertex,edge);
        log.info("String_Node_Str" + edge.getConnection());
      }
    }
    for (    HexSide side : HexSide.head()) {
      MapHex neighborHex=mapManager.getNeighbour(hex,side);
      if (neighborHex == null) {
        log.info("String_Node_Str" + hex.getId() + "String_Node_Str"+ hex.getOrientationName(side)+ "String_Node_Str");
        continue;
      }
      NetworkVertex vertex=getVertex(hex,side);
      HexSide rotated=side.opposite();
      NetworkVertex otherVertex=getVertex(neighborHex,rotated);
      if (vertex == null && otherVertex == null) {
        log.info("String_Node_Str" + hex.getId() + "String_Node_Str"+ hex.getOrientationName(side));
        log.info("String_Node_Str" + neighborHex.getId() + "String_Node_Str"+ neighborHex.getOrientationName(rotated));
        continue;
      }
 else       if (vertex == null && otherVertex != null) {
        log.info("String_Node_Str" + neighborHex.getId() + "String_Node_Str"+ neighborHex.getOrientationName(rotated)+ "String_Node_Str"+ hex.getId()+ "String_Node_Str"+ hex.getOrientationName(side));
        vertex=new NetworkVertex(hex,side);
        graph.addVertex(vertex);
        vertices.put(vertex.getIdentifier(),vertex);
        log.info("String_Node_Str" + vertex);
      }
 else       if (otherVertex == null) {
        log.info("String_Node_Str" + hex.getId() + "String_Node_Str"+ hex.getOrientationName(side)+ "String_Node_Str"+ neighborHex.getId()+ "String_Node_Str"+ neighborHex.getOrientationName(rotated));
        otherVertex=new NetworkVertex(neighborHex,rotated);
        graph.addVertex(otherVertex);
        vertices.put(otherVertex.getIdentifier(),otherVertex);
        log.info("String_Node_Str" + otherVertex);
      }
      NetworkEdge edge=new NetworkEdge(vertex,otherVertex,true);
      graph.addEdge(vertex,otherVertex,edge);
      log.info("String_Node_Str" + edge.getConnection());
    }
  }
  if (revenueManager != null) {
    revenueManager.initGraphModifiers(this);
  }
}