Program: 70031
Project: 70031
Buggy source:
public void event(UserRequest ureq,Controller source,Event event){
  if (source == deleteYesNoController) {
    if (DialogBoxUIFactory.isYesEvent(event)) {
      Kalendar cal=kalendarEvent.getCalendar();
      CalendarManagerFactory.getInstance().getCalendarManager().removeEventFrom(cal,kalendarEvent);
      fireEvent(ureq,Event.DONE_EVENT);
    }
  }
 else   if (source == copyEventToCalendarController) {
    if (event.equals(Event.DONE_EVENT))     fireEvent(ureq,Event.DONE_EVENT);
 else     if (event.equals(Event.CANCELLED_EVENT))     mainPanel.setContent(mainVC);
  }
 else   if (source == activeLinkProvider) {
    if (kalendarEvent.getCalendar() != null) {
      fireEvent(ureq,Event.DONE_EVENT);
    }
  }
 else   if (source == eventForm) {
    if (event == Event.DONE_EVENT) {
      kalendarEvent=eventForm.getUpdatedKalendarEvent();
      boolean doneSuccessfully=true;
      if (isNew) {
        String calendarID=eventForm.getChoosenKalendarID();
        for (Iterator iter=availableCalendars.iterator(); iter.hasNext(); ) {
          KalendarRenderWrapper calendarWrapper=(KalendarRenderWrapper)iter.next();
          if (!calendarWrapper.getKalendar().getCalendarID().equals(calendarID))           continue;
          Kalendar cal=calendarWrapper.getKalendar();
          boolean result=CalendarManagerFactory.getInstance().getCalendarManager().addEventTo(cal,kalendarEvent);
          if (result == false) {
            doneSuccessfully=false;
          }
        }
      }
 else {
        Kalendar cal=kalendarEvent.getCalendar();
        doneSuccessfully=CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(cal,kalendarEvent);
      }
      if (!doneSuccessfully) {
        showError("String_Node_Str");
        fireEvent(ureq,Event.FAILED_EVENT);
        return;
      }
      if (eventForm.isMulti()) {
        removeAsListenerAndDispose(copyEventToCalendarController);
        copyEventToCalendarController=new CopyEventToCalendarController(kalendarEvent,availableCalendars,getTranslator(),getWindowControl());
        listenTo(copyEventToCalendarController);
        mainPanel.setContent(copyEventToCalendarController.getInitialComponent());
        return;
      }
      fireEvent(ureq,Event.DONE_EVENT);
    }
 else     if (event == Event.CANCELLED_EVENT) {
      eventForm.setEntry(kalendarEvent);
      fireEvent(ureq,Event.DONE_EVENT);
    }
  }
 else   if (source == customMediaChooserCtr) {
    boolean doneSuccessfully=true;
    if (event instanceof URLChoosenEvent) {
      URLChoosenEvent urlEvent=(URLChoosenEvent)event;
      String url=urlEvent.getURL();
      List<KalendarEventLink> links=kalendarEvent.getKalendarEventLinks();
      String provider=customMediaChooserCtr.getClass().getSimpleName();
      String id=url;
      String displayName=StringHelper.containsNonWhitespace(urlEvent.getDisplayName()) ? urlEvent.getDisplayName() : url;
      String uri=url.contains("String_Node_Str") ? url : (Settings.getServerContextPathURI() + url);
      String iconCssClass=urlEvent.getIconCssClass();
      if (!StringHelper.containsNonWhitespace(iconCssClass)) {
        iconCssClass=CSSHelper.createFiletypeIconCssClassFor(url);
      }
      links.add(new KalendarEventLink(provider,id,displayName,uri,iconCssClass));
      Kalendar cal=kalendarEvent.getCalendar();
      doneSuccessfully=CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(cal,kalendarEvent);
    }
    if (doneSuccessfully) {
      fireEvent(ureq,event);
    }
 else {
      showError("String_Node_Str");
      fireEvent(ureq,Event.FAILED_EVENT);
    }
  }
 else   if (source == externalLinksController || source == mediaLinksController) {
    Kalendar cal=kalendarEvent.getCalendar();
    if (kalendarEvent.getCalendar() != null) {
      boolean doneSuccessfully=CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(cal,kalendarEvent);
      if (doneSuccessfully) {
        fireEvent(ureq,Event.DONE_EVENT);
      }
 else {
        showError("String_Node_Str");
        fireEvent(ureq,Event.FAILED_EVENT);
      }
    }
  }
}

Fixed version (ground truth):
public void event(UserRequest ureq,Controller source,Event event){
  if (source == deleteYesNoController) {
    if (DialogBoxUIFactory.isYesEvent(event)) {
      Kalendar cal=kalendarEvent.getCalendar();
      CalendarManagerFactory.getInstance().getCalendarManager().removeEventFrom(cal,kalendarEvent);
      fireEvent(ureq,Event.DONE_EVENT);
    }
  }
 else   if (source == copyEventToCalendarController) {
    if (event.equals(Event.DONE_EVENT))     fireEvent(ureq,Event.DONE_EVENT);
 else     if (event.equals(Event.CANCELLED_EVENT)) {
      eventForm.setMulti(false);
      mainPanel.setContent(mainVC);
    }
  }
 else   if (source == activeLinkProvider) {
    if (kalendarEvent.getCalendar() != null) {
      fireEvent(ureq,Event.DONE_EVENT);
    }
  }
 else   if (source == eventForm) {
    if (event == Event.DONE_EVENT) {
      kalendarEvent=eventForm.getUpdatedKalendarEvent();
      boolean doneSuccessfully=true;
      if (isNew) {
        String calendarID=eventForm.getChoosenKalendarID();
        for (Iterator iter=availableCalendars.iterator(); iter.hasNext(); ) {
          KalendarRenderWrapper calendarWrapper=(KalendarRenderWrapper)iter.next();
          if (!calendarWrapper.getKalendar().getCalendarID().equals(calendarID))           continue;
          Kalendar cal=calendarWrapper.getKalendar();
          boolean result=CalendarManagerFactory.getInstance().getCalendarManager().addEventTo(cal,kalendarEvent);
          if (result == false) {
            doneSuccessfully=false;
          }
        }
      }
 else {
        Kalendar cal=kalendarEvent.getCalendar();
        doneSuccessfully=CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(cal,kalendarEvent);
      }
      if (!doneSuccessfully) {
        showError("String_Node_Str");
        fireEvent(ureq,Event.FAILED_EVENT);
        return;
      }
      if (eventForm.isMulti()) {
        removeAsListenerAndDispose(copyEventToCalendarController);
        copyEventToCalendarController=new CopyEventToCalendarController(kalendarEvent,availableCalendars,getTranslator(),getWindowControl());
        listenTo(copyEventToCalendarController);
        mainPanel.setContent(copyEventToCalendarController.getInitialComponent());
        return;
      }
      fireEvent(ureq,Event.DONE_EVENT);
    }
 else     if (event == Event.CANCELLED_EVENT) {
      eventForm.setEntry(kalendarEvent);
      fireEvent(ureq,Event.DONE_EVENT);
    }
  }
 else   if (source == customMediaChooserCtr) {
    boolean doneSuccessfully=true;
    if (event instanceof URLChoosenEvent) {
      URLChoosenEvent urlEvent=(URLChoosenEvent)event;
      String url=urlEvent.getURL();
      List<KalendarEventLink> links=kalendarEvent.getKalendarEventLinks();
      String provider=customMediaChooserCtr.getClass().getSimpleName();
      String id=url;
      String displayName=StringHelper.containsNonWhitespace(urlEvent.getDisplayName()) ? urlEvent.getDisplayName() : url;
      String uri=url.contains("String_Node_Str") ? url : (Settings.getServerContextPathURI() + url);
      String iconCssClass=urlEvent.getIconCssClass();
      if (!StringHelper.containsNonWhitespace(iconCssClass)) {
        iconCssClass=CSSHelper.createFiletypeIconCssClassFor(url);
      }
      links.add(new KalendarEventLink(provider,id,displayName,uri,iconCssClass));
      Kalendar cal=kalendarEvent.getCalendar();
      doneSuccessfully=CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(cal,kalendarEvent);
    }
    if (doneSuccessfully) {
      fireEvent(ureq,event);
    }
 else {
      showError("String_Node_Str");
      fireEvent(ureq,Event.FAILED_EVENT);
    }
  }
 else   if (source == externalLinksController || source == mediaLinksController) {
    Kalendar cal=kalendarEvent.getCalendar();
    if (kalendarEvent.getCalendar() != null) {
      boolean doneSuccessfully=CalendarManagerFactory.getInstance().getCalendarManager().updateEventFrom(cal,kalendarEvent);
      if (doneSuccessfully) {
        fireEvent(ureq,Event.DONE_EVENT);
      }
 else {
        showError("String_Node_Str");
        fireEvent(ureq,Event.FAILED_EVENT);
      }
    }
  }
}