Program: 69579
Project: 69579
Buggy source:
private void doHandleToolEvents(UserRequest ureq,String cmd){
  if (cmd.indexOf(CMD_START_GROUP_PREFIX) == 0) {
    String groupIdent=cmd.substring(CMD_START_GROUP_PREFIX.length());
    Long groupKey=new Long(Long.parseLong(groupIdent));
    BusinessGroup group=businessGroupService.loadBusinessGroup(groupKey);
    if (group != null && businessGroupService.isIdentityInBusinessGroup(ureq.getIdentity(),group)) {
      String bsuinessPath="String_Node_Str" + group.getKey() + "String_Node_Str";
      NewControllerFactory.getInstance().launch(bsuinessPath,ureq,getWindowControl());
    }
 else {
      getWindowControl().setError(translate("String_Node_Str"));
      logAudit("String_Node_Str" + "String_Node_Str" + groupKey,null);
      reloadGroupMemberships(ureq.getIdentity());
      removeAsListenerAndDispose(toolC);
      toolC=initToolController(ureq.getIdentity(),ureq);
      listenTo(toolC);
      Component toolComp=(toolC == null ? null : toolC.getInitialComponent());
      columnLayoutCtr.setCol2(toolComp);
    }
  }
 else   if (cmd.equals(COMMAND_EDIT)) {
    doEdit(ureq);
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchMembersManagement(ureq);
  }
 else   if (cmd.equals("String_Node_Str")) {
    if (hasCourseRight(CourseRights.RIGHT_STATISTICS) || isCourseAdmin) {
      currentToolCtr=new StatisticMainController(ureq,getWindowControl(),course);
      listenTo(currentToolCtr);
      all.pushController(translate("String_Node_Str"),currentToolCtr);
    }
 else     throw new OLATSecurityException("String_Node_Str");
  }
 else   if (cmd.equals(TOOL_CHAT)) {
    boolean vip=isCourseCoach || isCourseAdmin;
    OpenInstantMessageEvent event=new OpenInstantMessageEvent(ureq,course,courseTitle,vip);
    ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(event,InstantMessagingService.TOWER_EVENT_ORES);
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchAssessmentStatistics(ureq,"String_Node_Str","String_Node_Str",QTIType.test,QTIType.onyx);
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchAssessmentStatistics(ureq,"String_Node_Str","String_Node_Str",QTIType.survey);
  }
 else   if (cmd.equals("String_Node_Str")) {
    if (hasCourseRight(CourseRights.RIGHT_DB) || isCourseAdmin) {
      currentToolCtr=new CustomDBMainController(ureq,getWindowControl(),course);
      listenTo(currentToolCtr);
      all.pushController(translate("String_Node_Str"),currentToolCtr);
    }
 else     throw new OLATSecurityException("String_Node_Str");
  }
 else   if (cmd.equals("String_Node_Str")) {
    if (hasCourseRight(CourseRights.RIGHT_ARCHIVING) || isCourseAdmin) {
      currentToolCtr=new ArchiverMainController(ureq,getWindowControl(),course,new IArchiverCallback(){
        public boolean mayArchiveQtiResults(){
          return true;
        }
        public boolean mayArchiveLogfiles(){
          return true;
        }
        public boolean mayArchiveCoursestructure(){
          return true;
        }
        public boolean mayArchiveProperties(){
          return true;
        }
        public boolean mayArchiveHandedInTasks(){
          return true;
        }
        public boolean mayArchiveForums(){
          return true;
        }
        public boolean mayArchiveDialogs(){
          return true;
        }
        public boolean mayArchiveWikis(){
          return true;
        }
        public boolean mayArchiveProjectBroker(){
          return true;
        }
        @Override public boolean mayArchiveScorm(){
          return true;
        }
        @Override public boolean mayArchiveChecklist(){
          return true;
        }
      }
);
      listenTo(currentToolCtr);
      all.pushController(translate("String_Node_Str"),currentToolCtr);
    }
 else     throw new OLATSecurityException("String_Node_Str");
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchAssessmentTool(ureq,null);
  }
 else   if (cmd.equals("String_Node_Str")) {
    ControllerCreator ctrlCreator=new ControllerCreator(){
      public Controller createController(      UserRequest lureq,      WindowControl lwControl){
        EfficiencyStatementController efficiencyStatementController=new EfficiencyStatementController(lwControl,lureq,courseRepositoryEntry.getKey());
        LayoutMain3ColsController layoutCtr=new LayoutMain3ColsController(lureq,getWindowControl(),null,null,efficiencyStatementController.getInitialComponent(),null);
        layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(),uce.getCourseEnvironment()));
        return layoutCtr;
      }
    }
;
    ControllerCreator layoutCtrlr=BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq,ctrlCreator);
    openInNewBrowserWindow(ureq,layoutCtrlr);
  }
 else   if (cmd.equals("String_Node_Str")) {
    ControllerCreator ctrlCreator=new ControllerCreator(){
      public Controller createController(      UserRequest lureq,      WindowControl lwControl){
        Controller notesCtr=new NoteController(lureq,course,getExtendedCourseTitle(lureq.getLocale()),lwControl);
        LayoutMain3ColsController layoutCtr=new LayoutMain3ColsController(lureq,lwControl,null,null,notesCtr.getInitialComponent(),null);
        layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(),uce.getCourseEnvironment()));
        layoutCtr.addDisposableChildController(notesCtr);
        return layoutCtr;
      }
    }
;
    ControllerCreator popupLayoutCtr=BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq,ctrlCreator);
    openInNewBrowserWindow(ureq,popupLayoutCtr);
  }
 else   if (cmd.equals(TOOLBOX_LINK_COURSECONFIG)) {
    ChiefController chief=(ChiefController)Windows.getWindows(ureq).getAttribute("String_Node_Str");
    if (chief.hasStaticSite(RepositorySite.class)) {
      String businessPath="String_Node_Str" + courseRepositoryEntry.getKey() + "String_Node_Str";
      NewControllerFactory.getInstance().launch(businessPath,ureq,getWindowControl());
    }
  }
 else   if (cmd.equals(ACTION_BOOKMARK)) {
    boolean marked=markManager.isMarked(courseRepositoryEntry,getIdentity(),null);
    if (marked) {
      markManager.removeMark(courseRepositoryEntry,getIdentity(),null);
    }
 else {
      String businessPath="String_Node_Str" + courseRepositoryEntry.getKey() + "String_Node_Str";
      markManager.setMark(courseRepositoryEntry,getIdentity(),null,businessPath);
    }
    String css=marked ? "String_Node_Str" : "String_Node_Str";
    toolC.setCssClass(TOOL_BOOKMARK,css);
  }
 else   if (cmd.equals(ACTION_CALENDAR)) {
    ControllerCreator ctrlCreator=new ControllerCreator(){
      public Controller createController(      UserRequest lureq,      WindowControl lwControl){
        ContextEntry ce=BusinessControlFactory.getInstance().createContextEntry(courseRepositoryEntry);
        WindowControl llwControl=BusinessControlFactory.getInstance().createBusinessWindowControl(ce,lwControl);
        CourseCalendarController calendarController=new CourseCalendarController(lureq,llwControl,course);
        LayoutMain3ColsController layoutCtr=new LayoutMain3ColsController(lureq,llwControl,null,null,calendarController.getInitialComponent(),null);
        layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(),uce.getCourseEnvironment()));
        layoutCtr.addDisposableChildController(calendarController);
        return layoutCtr;
      }
    }
;
    ControllerCreator layoutCtrlr=BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq,ctrlCreator);
    PopupBrowserWindow pbw=getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq,layoutCtrlr);
    pbw.open(ureq);
  }
}

Fixed version (ground truth):
private void doHandleToolEvents(UserRequest ureq,String cmd){
  if (cmd.indexOf(CMD_START_GROUP_PREFIX) == 0) {
    String groupIdent=cmd.substring(CMD_START_GROUP_PREFIX.length());
    Long groupKey=new Long(Long.parseLong(groupIdent));
    BusinessGroup group=businessGroupService.loadBusinessGroup(groupKey);
    if (group != null && businessGroupService.isIdentityInBusinessGroup(ureq.getIdentity(),group)) {
      String bsuinessPath="String_Node_Str" + group.getKey() + "String_Node_Str";
      NewControllerFactory.getInstance().launch(bsuinessPath,ureq,getWindowControl());
    }
 else {
      getWindowControl().setError(translate("String_Node_Str"));
      logAudit("String_Node_Str" + "String_Node_Str" + groupKey,null);
      reloadGroupMemberships(ureq.getIdentity());
      removeAsListenerAndDispose(toolC);
      toolC=initToolController(ureq.getIdentity(),ureq);
      listenTo(toolC);
      Component toolComp=(toolC == null ? null : toolC.getInitialComponent());
      columnLayoutCtr.setCol2(toolComp);
    }
  }
 else   if (cmd.equals(COMMAND_EDIT)) {
    doEdit(ureq);
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchMembersManagement(ureq);
  }
 else   if (cmd.equals("String_Node_Str")) {
    if (hasCourseRight(CourseRights.RIGHT_STATISTICS) || isCourseAdmin) {
      currentToolCtr=new StatisticMainController(ureq,getWindowControl(),course);
      listenTo(currentToolCtr);
      all.pushController(translate("String_Node_Str"),currentToolCtr);
    }
 else     throw new OLATSecurityException("String_Node_Str");
  }
 else   if (cmd.equals(TOOL_CHAT)) {
    boolean vip=isCourseCoach || isCourseAdmin;
    OpenInstantMessageEvent event=new OpenInstantMessageEvent(ureq,course,courseTitle,vip);
    ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(event,InstantMessagingService.TOWER_EVENT_ORES);
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchAssessmentStatistics(ureq,"String_Node_Str","String_Node_Str",QTIType.test,QTIType.onyx);
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchAssessmentStatistics(ureq,"String_Node_Str","String_Node_Str",QTIType.survey);
  }
 else   if (cmd.equals("String_Node_Str")) {
    if (hasCourseRight(CourseRights.RIGHT_DB) || isCourseAdmin) {
      currentToolCtr=new CustomDBMainController(ureq,getWindowControl(),course);
      listenTo(currentToolCtr);
      all.pushController(translate("String_Node_Str"),currentToolCtr);
    }
 else     throw new OLATSecurityException("String_Node_Str");
  }
 else   if (cmd.equals("String_Node_Str")) {
    if (hasCourseRight(CourseRights.RIGHT_ARCHIVING) || isCourseAdmin) {
      currentToolCtr=new ArchiverMainController(ureq,getWindowControl(),course,new IArchiverCallback(){
        public boolean mayArchiveQtiResults(){
          return true;
        }
        public boolean mayArchiveLogfiles(){
          return true;
        }
        public boolean mayArchiveCoursestructure(){
          return true;
        }
        public boolean mayArchiveProperties(){
          return true;
        }
        public boolean mayArchiveHandedInTasks(){
          return true;
        }
        public boolean mayArchiveForums(){
          return true;
        }
        public boolean mayArchiveDialogs(){
          return true;
        }
        public boolean mayArchiveWikis(){
          return true;
        }
        public boolean mayArchiveProjectBroker(){
          return true;
        }
        @Override public boolean mayArchiveScorm(){
          return true;
        }
        @Override public boolean mayArchiveChecklist(){
          return true;
        }
      }
);
      listenTo(currentToolCtr);
      all.pushController(translate("String_Node_Str"),currentToolCtr);
    }
 else     throw new OLATSecurityException("String_Node_Str");
  }
 else   if (cmd.equals("String_Node_Str")) {
    launchAssessmentTool(ureq,null);
  }
 else   if (cmd.equals("String_Node_Str")) {
    ControllerCreator ctrlCreator=new ControllerCreator(){
      public Controller createController(      UserRequest lureq,      WindowControl lwControl){
        EfficiencyStatementController efficiencyStatementController=new EfficiencyStatementController(lwControl,lureq,courseRepositoryEntry.getKey());
        LayoutMain3ColsController layoutCtr=new LayoutMain3ColsController(lureq,getWindowControl(),null,null,efficiencyStatementController.getInitialComponent(),null);
        layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(),uce.getCourseEnvironment()));
        return layoutCtr;
      }
    }
;
    ControllerCreator layoutCtrlr=BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq,ctrlCreator);
    openInNewBrowserWindow(ureq,layoutCtrlr);
  }
 else   if (cmd.equals("String_Node_Str")) {
    ControllerCreator ctrlCreator=new ControllerCreator(){
      public Controller createController(      UserRequest lureq,      WindowControl lwControl){
        Controller notesCtr=new NoteController(lureq,course,getExtendedCourseTitle(lureq.getLocale()),lwControl);
        LayoutMain3ColsController layoutCtr=new LayoutMain3ColsController(lureq,lwControl,null,null,notesCtr.getInitialComponent(),null);
        layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(),uce.getCourseEnvironment()));
        layoutCtr.addDisposableChildController(notesCtr);
        return layoutCtr;
      }
    }
;
    ControllerCreator popupLayoutCtr=BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq,ctrlCreator);
    openInNewBrowserWindow(ureq,popupLayoutCtr);
  }
 else   if (cmd.equals(TOOLBOX_LINK_COURSECONFIG)) {
    ChiefController chief=(ChiefController)Windows.getWindows(ureq).getAttribute("String_Node_Str");
    if (chief != null && chief.hasStaticSite(RepositorySite.class)) {
      String businessPath="String_Node_Str" + courseRepositoryEntry.getKey() + "String_Node_Str";
      NewControllerFactory.getInstance().launch(businessPath,ureq,getWindowControl());
    }
  }
 else   if (cmd.equals(ACTION_BOOKMARK)) {
    boolean marked=markManager.isMarked(courseRepositoryEntry,getIdentity(),null);
    if (marked) {
      markManager.removeMark(courseRepositoryEntry,getIdentity(),null);
    }
 else {
      String businessPath="String_Node_Str" + courseRepositoryEntry.getKey() + "String_Node_Str";
      markManager.setMark(courseRepositoryEntry,getIdentity(),null,businessPath);
    }
    String css=marked ? "String_Node_Str" : "String_Node_Str";
    toolC.setCssClass(TOOL_BOOKMARK,css);
  }
 else   if (cmd.equals(ACTION_CALENDAR)) {
    ControllerCreator ctrlCreator=new ControllerCreator(){
      public Controller createController(      UserRequest lureq,      WindowControl lwControl){
        ContextEntry ce=BusinessControlFactory.getInstance().createContextEntry(courseRepositoryEntry);
        WindowControl llwControl=BusinessControlFactory.getInstance().createBusinessWindowControl(ce,lwControl);
        CourseCalendarController calendarController=new CourseCalendarController(lureq,llwControl,course);
        LayoutMain3ColsController layoutCtr=new LayoutMain3ColsController(lureq,llwControl,null,null,calendarController.getInitialComponent(),null);
        layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(),uce.getCourseEnvironment()));
        layoutCtr.addDisposableChildController(calendarController);
        return layoutCtr;
      }
    }
;
    ControllerCreator layoutCtrlr=BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq,ctrlCreator);
    PopupBrowserWindow pbw=getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq,layoutCtrlr);
    pbw.open(ureq);
  }
}