Program: 163988
Project: 163988
Buggy source:
@Override public ArrayList<Room> build(ArrayList<Room> rooms){
  setupRooms(rooms);
  if (entrance == null) {
    return null;
  }
  entrance.setSize();
  entrance.setPos(0,0);
  float startAngle=Random.Float(0,360);
  ArrayList<Room> loop=new ArrayList<>();
  int roomsOnLoop=(int)(multiConnections.size() * pathLength) + Random.chances(pathLenJitterChances);
  roomsOnLoop=Math.min(roomsOnLoop,multiConnections.size());
  roomsOnLoop++;
  for (int i=0; i < roomsOnLoop; i++) {
    if (i == 0)     loop.add(entrance);
 else     loop.add(multiConnections.remove(0));
    int tunnels=Random.chances(pathTunnelChances);
    for (int j=0; j < tunnels; j++) {
      loop.add(ConnectionRoom.createRoom());
    }
  }
  if (exit != null)   loop.add(loop.size() / 2,exit);
  Room prev=entrance;
  float targetAngle;
  for (int i=1; i < loop.size(); i++) {
    Room r=loop.get(i);
    targetAngle=startAngle + targetAngle(i / (float)loop.size());
    if (placeRoom(rooms,prev,r,targetAngle) != -1) {
      prev=r;
      if (!rooms.contains(prev))       rooms.add(prev);
    }
 else {
      return null;
    }
  }
  if (!prev.connect(entrance)) {
    return null;
  }
  if (shop != null) {
    float angle;
    do {
      angle=placeRoom(loop,entrance,shop,Random.Float(360f));
    }
 while (angle == -1);
  }
  ArrayList<Room> branchable=new ArrayList<>(loop);
  ArrayList<Room> roomsToBranch=new ArrayList<>();
  roomsToBranch.addAll(multiConnections);
  roomsToBranch.addAll(singleConnections);
  weightRooms(branchable);
  createBranches(rooms,branchable,roomsToBranch,branchTunnelChances);
  findNeighbours(rooms);
  for (  Room r : rooms) {
    for (    Room n : r.neigbours) {
      if (!n.connected.containsKey(r) && Random.Float() < extraConnectionChance) {
        r.connect(n);
      }
    }
  }
  return rooms;
}

Fixed version (ground truth):
@Override public ArrayList<Room> build(ArrayList<Room> rooms){
  setupRooms(rooms);
  if (entrance == null) {
    return null;
  }
  entrance.setSize();
  entrance.setPos(0,0);
  float startAngle=Random.Float(0,360);
  ArrayList<Room> loop=new ArrayList<>();
  int roomsOnLoop=(int)(multiConnections.size() * pathLength) + Random.chances(pathLenJitterChances);
  roomsOnLoop=Math.min(roomsOnLoop,multiConnections.size());
  roomsOnLoop++;
  for (int i=0; i < roomsOnLoop; i++) {
    if (i == 0)     loop.add(entrance);
 else     loop.add(multiConnections.remove(0));
    int tunnels=Random.chances(pathTunnelChances);
    for (int j=0; j < tunnels; j++) {
      loop.add(ConnectionRoom.createRoom());
    }
  }
  if (exit != null)   loop.add((loop.size() + 1) / 2,exit);
  Room prev=entrance;
  float targetAngle;
  for (int i=1; i < loop.size(); i++) {
    Room r=loop.get(i);
    targetAngle=startAngle + targetAngle(i / (float)loop.size());
    if (placeRoom(rooms,prev,r,targetAngle) != -1) {
      prev=r;
      if (!rooms.contains(prev))       rooms.add(prev);
    }
 else {
      return null;
    }
  }
  while (!prev.connect(entrance)) {
    ConnectionRoom c=ConnectionRoom.createRoom();
    if (placeRoom(loop,prev,c,angleBetweenRooms(prev,entrance)) == -1) {
      return null;
    }
    loop.add(c);
    rooms.add(c);
    prev=c;
  }
  if (shop != null) {
    float angle;
    int tries=10;
    do {
      angle=placeRoom(loop,entrance,shop,Random.Float(360f));
      tries--;
    }
 while (angle == -1 && tries >= 0);
    if (angle == -1)     return null;
  }
  ArrayList<Room> branchable=new ArrayList<>(loop);
  ArrayList<Room> roomsToBranch=new ArrayList<>();
  roomsToBranch.addAll(multiConnections);
  roomsToBranch.addAll(singleConnections);
  weightRooms(branchable);
  createBranches(rooms,branchable,roomsToBranch,branchTunnelChances);
  findNeighbours(rooms);
  for (  Room r : rooms) {
    for (    Room n : r.neigbours) {
      if (!n.connected.containsKey(r) && Random.Float() < extraConnectionChance) {
        r.connect(n);
      }
    }
  }
  return rooms;
}