Program: 163989
Project: 163989
Buggy source:
protected static void createBranches(ArrayList<Room> rooms,ArrayList<Room> branchable,ArrayList<Room> roomsToBranch,float[] connChances){
  int i=0;
  float angle;
  int tries;
  Room curr;
  ArrayList<Room> connectingRoomsThisBranch=new ArrayList<>();
  while (i < roomsToBranch.size()) {
    connectingRoomsThisBranch.clear();
    curr=Random.element(branchable);
    int connectingRooms=Random.chances(connChances);
    for (int j=0; j < connectingRooms; j++) {
      ConnectionRoom t=ConnectionRoom.createRoom();
      tries=10;
      do {
        angle=placeRoom(rooms,curr,t,Random.Float(360f));
        tries--;
      }
 while (angle == -1 && tries >= 0);
      if (angle == -1) {
        for (        Room r : connectingRoomsThisBranch) {
          r.clearConnections();
          rooms.remove(r);
        }
        connectingRoomsThisBranch.clear();
        break;
      }
 else {
        connectingRoomsThisBranch.add(t);
        rooms.add(t);
      }
      curr=t;
    }
    if (connectingRoomsThisBranch.size() != connectingRooms) {
      continue;
    }
    Room r=roomsToBranch.get(i);
    tries=10;
    do {
      angle=placeRoom(rooms,curr,r,Random.Float(360f));
      tries--;
    }
 while (angle == -1 && tries >= 0);
    if (angle == -1) {
      for (      Room t : connectingRoomsThisBranch) {
        t.clearConnections();
        rooms.remove(t);
      }
      connectingRoomsThisBranch.clear();
      continue;
    }
    branchable.addAll(connectingRoomsThisBranch);
    if (r.maxConnections(Room.ALL) > 1) {
      if (r instanceof StandardRoom) {
        for (int j=0; j < ((StandardRoom)r).sizeCat.connectionWeight(); j++) {
          branchable.add(r);
        }
      }
 else {
        branchable.add(r);
      }
    }
    i++;
  }
}

Fixed version (ground truth):
protected static void createBranches(ArrayList<Room> rooms,ArrayList<Room> branchable,ArrayList<Room> roomsToBranch,float[] connChances){
  int i=0;
  float angle;
  int tries;
  Room curr;
  ArrayList<Room> connectingRoomsThisBranch=new ArrayList<>();
  while (i < roomsToBranch.size()) {
    connectingRoomsThisBranch.clear();
    curr=Random.element(branchable);
    int connectingRooms=Random.chances(connChances);
    for (int j=0; j < connectingRooms; j++) {
      ConnectionRoom t=ConnectionRoom.createRoom();
      tries=10;
      do {
        angle=placeRoom(rooms,curr,t,Random.Float(360f));
        tries--;
      }
 while (angle == -1 && tries >= 0);
      if (angle == -1) {
        for (        Room r : connectingRoomsThisBranch) {
          r.clearConnections();
          rooms.remove(r);
        }
        connectingRoomsThisBranch.clear();
        break;
      }
 else {
        connectingRoomsThisBranch.add(t);
        rooms.add(t);
      }
      curr=t;
    }
    if (connectingRoomsThisBranch.size() != connectingRooms) {
      continue;
    }
    Room r=roomsToBranch.get(i);
    tries=10;
    do {
      angle=placeRoom(rooms,curr,r,Random.Float(360f));
      tries--;
    }
 while (angle == -1 && tries >= 0);
    if (angle == -1) {
      for (      Room t : connectingRoomsThisBranch) {
        t.clearConnections();
        rooms.remove(t);
      }
      connectingRoomsThisBranch.clear();
      continue;
    }
    if (Random.Float() < 0.33f)     branchable.addAll(connectingRoomsThisBranch);
    if (r.maxConnections(Room.ALL) > 1) {
      if (r instanceof StandardRoom) {
        for (int j=0; j < ((StandardRoom)r).sizeCat.connectionWeight(); j++) {
          branchable.add(r);
        }
      }
 else {
        branchable.add(r);
      }
    }
    i++;
  }
}