Program: 98903
Project: 98903
Buggy source:
/** 
 * Puts the TravelPorts into a csv file.
 * @param travelPorts the ports to save.
 * @param csvFile     the file to save.
 * @throws java.io.IOException thrown when there is an error during writing.
 */
static void savePorts(Map<Integer,TravelPort> travelPorts,File csvFile) throws IOException {
  BufferedWriter writer=new BufferedWriter(new FileWriter(csvFile));
  for (  TravelPort port : travelPorts.values()) {
    StringBuilder line=new StringBuilder();
    for (int index=0; index < CSV_COLUMNS; ++index) {
switch (index) {
case INDEX_ID:
        line.append(port.getId());
      break;
case INDEX_NAME:
    line.append(port.getName());
  break;
case INDEX_TARGET:
line.append(port.getTargetId());
break;
case INDEX_OWNER:
line.append(port.getOwner());
break;
case INDEX_ALLOWED:
if (port.isAllowedToEverybody()) {
line.append("String_Node_Str");
}
 else {
line.append(StringHelper.encode(port.getAllowed()));
}
break;
case INDEX_PASSWORD:
line.append(port.getPassword());
break;
case INDEX_PRICE:
line.append(port.getPrice());
break;
case INDEX_WORLD:
line.append(port.getEdge1().getWorld().getName());
break;
case INDEX_EDGE1_X:
line.append(port.getEdge1().getBlockX());
break;
case INDEX_EDGE1_Y:
line.append(port.getEdge1().getBlockY());
break;
case INDEX_EDGE1_Z:
line.append(port.getEdge1().getBlockZ());
break;
case INDEX_EDGE2_X:
line.append(port.getEdge2().getBlockX());
break;
case INDEX_EDGE2_Y:
line.append(port.getEdge2().getBlockY());
break;
case INDEX_EDGE2_Z:
line.append(port.getEdge2().getBlockY());
break;
case INDEX_DESTINATION_X:
line.append(port.getDestination().getBlockX());
break;
case INDEX_DESTINATION_Y:
line.append(port.getDestination().getBlockY());
break;
case INDEX_DESTINATION_Z:
line.append(port.getDestination().getBlockY());
break;
default :
throw new RuntimeException("String_Node_Str");
}
if (index + 1 < CSV_COLUMNS) {
line.append("String_Node_Str");
}
}
writer.append(line.toString());
writer.newLine();
}
writer.close();
}

Fixed version (ground truth):
/** 
 * Puts the TravelPorts into a csv file.
 * @param travelPorts the ports to save.
 * @param csvFile     the file to save.
 * @throws java.io.IOException thrown when there is an error during writing.
 */
static void savePorts(Map<Integer,TravelPort> travelPorts,File csvFile) throws IOException {
  BufferedWriter writer=new BufferedWriter(new FileWriter(csvFile));
  for (  TravelPort port : travelPorts.values()) {
    StringBuilder line=new StringBuilder();
    for (int index=0; index < CSV_COLUMNS; ++index) {
switch (index) {
case INDEX_ID:
        line.append(port.getId());
      break;
case INDEX_NAME:
    line.append(port.getName());
  break;
case INDEX_TARGET:
line.append(port.getTargetId());
break;
case INDEX_OWNER:
line.append(port.getOwner());
break;
case INDEX_ALLOWED:
if (port.isAllowedToEverybody()) {
line.append("String_Node_Str");
}
 else {
line.append(StringHelper.encode(port.getAllowed()));
}
break;
case INDEX_PASSWORD:
line.append(port.getPassword());
break;
case INDEX_PRICE:
line.append(port.getPrice());
break;
case INDEX_WORLD:
line.append(port.getEdge1().getWorld().getName());
break;
case INDEX_EDGE1_X:
line.append(port.getEdge1().getX());
break;
case INDEX_EDGE1_Y:
line.append(port.getEdge1().getY());
break;
case INDEX_EDGE1_Z:
line.append(port.getEdge1().getZ());
break;
case INDEX_EDGE2_X:
line.append(port.getEdge2().getX());
break;
case INDEX_EDGE2_Y:
line.append(port.getEdge2().getY());
break;
case INDEX_EDGE2_Z:
line.append(port.getEdge2().getZ());
break;
case INDEX_DESTINATION_X:
line.append(port.getDestination().getX());
break;
case INDEX_DESTINATION_Y:
line.append(port.getDestination().getY());
break;
case INDEX_DESTINATION_Z:
line.append(port.getDestination().getZ());
break;
default :
throw new RuntimeException("String_Node_Str");
}
if (index + 1 < CSV_COLUMNS) {
line.append("String_Node_Str");
}
}
writer.append(line.toString());
writer.newLine();
}
writer.close();
}