Program: 69783
Project: 69783
Buggy source:
/** 
 * Process the list of nodes to import. Call importNode on each node, starting at currentPos in the list of nodes. If a node provides a Controller, set the activeImportController to the Controller returned by the importNode(), active this controller and return false. The calling method should then just exit its event() method and yield control to the activeImportController. When the activeImportController is finished, it sends a Event.DONE_EVENT and this controller continues to process the nodes in the list.
 * @param ureq
 * @return True if the whole list is processed, false otherwise.
 */
private boolean processNodeList(UserRequest ureq){
  while (nodeListPos < nodeList.size()) {
    CourseEditorTreeNode nextNode=nodeList.get(nodeListPos);
    nodeListPos++;
    Controller ctrl=nextNode.getCourseNode().importNode(course.getCourseExportDataDir().getBasefile(),course,false,ureq,getWindowControl());
    if (ctrl != null) {
      removeAsListenerAndDispose(activeImportController);
      activeImportController=ctrl;
      listenTo(activeImportController);
      while (importYesMode) {
        if (ctrl instanceof ImportReferencesController) {
          ((ImportReferencesController)ctrl).importWithoutAsking(ureq);
          break;
        }
        if (ctrl instanceof ImportPortfolioReferencesController) {
          ((ImportPortfolioReferencesController)ctrl).importWithoutAsking(ureq);
          break;
        }
        break;
      }
      if (nodeListPos == nodeList.size()) {
        return true;
      }
      myPanel.setContent(activeImportController.getInitialComponent());
      return false;
    }
 else {
      if (nodeListPos == nodeList.size()) {
        return true;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Process the list of nodes to import. Call importNode on each node, starting at currentPos in the list of nodes. If a node provides a Controller, set the activeImportController to the Controller returned by the importNode(), active this controller and return false. The calling method should then just exit its event() method and yield control to the activeImportController. When the activeImportController is finished, it sends a Event.DONE_EVENT and this controller continues to process the nodes in the list.
 * @param ureq
 * @return True if the whole list is processed, false otherwise.
 */
private boolean processNodeList(UserRequest ureq){
  while (nodeListPos < nodeList.size()) {
    CourseEditorTreeNode nextNode=nodeList.get(nodeListPos);
    nodeListPos++;
    Controller ctrl=nextNode.getCourseNode().importNode(course.getCourseExportDataDir().getBasefile(),course,false,ureq,getWindowControl());
    if (ctrl != null) {
      removeAsListenerAndDispose(activeImportController);
      activeImportController=ctrl;
      listenTo(activeImportController);
      while (importYesMode) {
        if (ctrl instanceof ImportReferencesController) {
          ((ImportReferencesController)ctrl).importWithoutAsking(ureq);
          break;
        }
        if (ctrl instanceof ImportPortfolioReferencesController) {
          ((ImportPortfolioReferencesController)ctrl).importWithoutAsking(ureq);
          break;
        }
        break;
      }
      myPanel.setContent(activeImportController.getInitialComponent());
      return false;
    }
 else     if (nodeListPos == nodeList.size()) {
      return true;
    }
  }
  return true;
}