Program: 173435
Project: 173435
Buggy source:
public void finishConfiguration(RailsRoot root) throws ConfigurationException {
  for (  MapHex hex : hexes.values()) {
    hex.finishConfiguration(root);
  }
  for (  MapHex hex : hexes.values()) {
    for (    HexSide side : HexSide.all()) {
      MapHex neighbour=hexes.get(mapOrientation.getAdjacentCoordinates(hex.getCoordinates(),side));
      if (neighbour != null) {
        if (hex.isValidNeighbour(neighbour,side)) {
          hexTable.put(hex,side,neighbour);
        }
 else {
          hex.addInvalidSide(side);
          if (hex.isImpassableNeighbour(neighbour)) {
            hex.addImpassableSide(side);
            neighbour.addImpassableSide(side);
          }
        }
      }
 else {
        hex.addInvalidSide(side);
      }
    }
  }
  for (  PublicCompany company : root.getCompanyManager().getAllPublicCompanies()) {
    List<MapHex> homeHexes=company.getHomeHexes();
    if (homeHexes != null) {
      for (      MapHex homeHex : homeHexes) {
        int homeNumber=company.getHomeCityNumber();
        Stop home=homeHex.getRelatedStop(homeNumber);
        if (home == null && homeNumber != 0) {
          throw new ConfigurationException("String_Node_Str" + homeNumber + "String_Node_Str"+ homeHex+ "String_Node_Str"+ homeHex.getStops().size()+ "String_Node_Str");
        }
 else {
          homeHex.addHome(company,home);
        }
      }
    }
    MapHex hex=company.getDestinationHex();
    if (hex != null) {
      hex.addDestination(company);
    }
  }
  mapImageUsed=net.sf.rails.util.Util.hasValue(mapImageFilename) && "String_Node_Str".equalsIgnoreCase(Config.get("String_Node_Str"));
  if (mapImageUsed) {
    String rootDirectory=Config.get("String_Node_Str");
    if (!net.sf.rails.util.Util.hasValue(rootDirectory)) {
      rootDirectory="String_Node_Str";
    }
    mapImageFilepath="String_Node_Str" + rootDirectory + "String_Node_Str"+ mapImageFilename;
  }
}

Fixed version (ground truth):
public void finishConfiguration(RailsRoot root) throws ConfigurationException {
  for (  MapHex hex : hexes.values()) {
    hex.finishConfiguration(root);
  }
  for (  MapHex hex : hexes.values()) {
    for (    HexSide side : HexSide.all()) {
      MapHex neighbour=hexes.get(mapOrientation.getAdjacentCoordinates(hex.getCoordinates(),side));
      if (neighbour != null) {
        if (hex.isValidNeighbour(neighbour,side)) {
          hexTable.put(hex,side,neighbour);
        }
 else {
          hex.addInvalidSide(side);
          if (hex.isImpassableNeighbour(neighbour)) {
            hex.addImpassableSide(side);
            neighbour.addImpassableSide(side.opposite());
          }
        }
      }
 else {
        hex.addInvalidSide(side);
      }
    }
  }
  for (  PublicCompany company : root.getCompanyManager().getAllPublicCompanies()) {
    List<MapHex> homeHexes=company.getHomeHexes();
    if (homeHexes != null) {
      for (      MapHex homeHex : homeHexes) {
        int homeNumber=company.getHomeCityNumber();
        Stop home=homeHex.getRelatedStop(homeNumber);
        if (home == null && homeNumber != 0) {
          throw new ConfigurationException("String_Node_Str" + homeNumber + "String_Node_Str"+ homeHex+ "String_Node_Str"+ homeHex.getStops().size()+ "String_Node_Str");
        }
 else {
          homeHex.addHome(company,home);
        }
      }
    }
    MapHex hex=company.getDestinationHex();
    if (hex != null) {
      hex.addDestination(company);
    }
  }
  mapImageUsed=net.sf.rails.util.Util.hasValue(mapImageFilename) && "String_Node_Str".equalsIgnoreCase(Config.get("String_Node_Str"));
  if (mapImageUsed) {
    String rootDirectory=Config.get("String_Node_Str");
    if (!net.sf.rails.util.Util.hasValue(rootDirectory)) {
      rootDirectory="String_Node_Str";
    }
    mapImageFilepath="String_Node_Str" + rootDirectory + "String_Node_Str"+ mapImageFilename;
  }
}