Program: 69576
Project: 69576
Buggy source:
/** 
 * Constructor for the contact form run controller
 * @param moduleConfiguration
 * @param ureq
 * @param wControl
 * @param coCourseNode
 */
public CORunController(ModuleConfiguration moduleConfiguration,UserRequest ureq,WindowControl wControl,UserCourseEnvironment userCourseEnv,COCourseNode coCourseNode){
  super(ureq,wControl);
  cgm=userCourseEnv.getCourseEnvironment().getCourseGroupManager();
  areaManager=CoreSpringFactory.getImpl(BGAreaManager.class);
  businessGroupService=CoreSpringFactory.getImpl(BusinessGroupService.class);
  Translator fallback=Util.createPackageTranslator(ContactFormController.class,ureq.getLocale());
  setTranslator(Util.createPackageTranslator(CORunController.class,ureq.getLocale(),fallback));
  @SuppressWarnings("String_Node_Str") List<String> emailListConfig=(List<String>)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOADRESSES);
  String mSubject=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_MSUBJECT_DEFAULT);
  String mBody=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_MBODY_DEFAULT);
  myContent=createVelocityContainer("String_Node_Str");
  myContent.contextPut("String_Node_Str",coCourseNode.getShortTitle());
  myContent.contextPut("String_Node_Str",coCourseNode.getLongTitle());
  String learningObj=coCourseNode.getLearningObjectives();
  Panel panel=new Panel("String_Node_Str");
  myContent.put("String_Node_Str",panel);
  if (learningObj != null) {
    Component learningObjectives=ObjectivesHelper.createLearningObjectivesComponent(learningObj,ureq);
    panel.setContent(learningObjectives);
  }
  Boolean partipsConfigured=moduleConfiguration.getBooleanEntry(COEditController.CONFIG_KEY_EMAILTOPARTICIPANTS);
  Boolean coachesConfigured=moduleConfiguration.getBooleanEntry(COEditController.CONFIG_KEY_EMAILTOCOACHES);
  Stack<ContactList> contactLists=new Stack<ContactList>();
  String grpNames=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOGROUPS);
  @SuppressWarnings("String_Node_Str") List<Long> groupKeys=(List<Long>)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOGROUP_IDS);
  if (groupKeys == null && StringHelper.containsNonWhitespace(grpNames)) {
    groupKeys=businessGroupService.toGroupKeys(grpNames,cgm.getCourseEntry());
  }
  if (coachesConfigured != null && coachesConfigured.booleanValue()) {
    ContactList cl=retrieveCoachesFromGroups(groupKeys);
    contactLists.push(cl);
  }
  if (partipsConfigured != null && partipsConfigured.booleanValue()) {
    ContactList cl=retrieveParticipantsFromGroups(groupKeys);
    contactLists.push(cl);
  }
  String areaNames=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOAREAS);
  @SuppressWarnings("String_Node_Str") List<Long> areaKeys=(List<Long>)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOAREA_IDS);
  if (areaKeys == null && StringHelper.containsNonWhitespace(areaNames)) {
    areaKeys=areaManager.toAreaKeys(areaNames,cgm.getCourseResource());
  }
  if (coachesConfigured != null && coachesConfigured.booleanValue()) {
    ContactList cl=retrieveCoachesFromAreas(areaKeys);
    contactLists.push(cl);
  }
  if (partipsConfigured != null && partipsConfigured.booleanValue()) {
    ContactList cl=retrieveParticipantsFromAreas(areaKeys);
    contactLists.push(cl);
  }
  if (emailListConfig != null) {
    ContactList emailList=new ContactList(translate("String_Node_Str"));
    for (Iterator<String> iter=emailListConfig.iterator(); iter.hasNext(); ) {
      String email=iter.next();
      emailList.add(email);
    }
    contactLists.push(emailList);
  }
  if (contactLists.size() > 0) {
    ContactMessage cmsg=new ContactMessage(ureq.getIdentity());
    while (!contactLists.empty()) {
      ContactList cl=contactLists.pop();
      cmsg.addEmailTo(cl);
    }
    cmsg.setBodyText(mBody);
    cmsg.setSubject(mSubject);
    coFoCtr=new ContactFormController(ureq,getWindowControl(),false,false,false,cmsg);
    listenTo(coFoCtr);
    myContent.put("String_Node_Str",coFoCtr.getInitialComponent());
    putInitialPanel(myContent);
  }
 else {
    String message=translate("String_Node_Str");
    Controller mCtr=MessageUIFactory.createInfoMessage(ureq,getWindowControl(),null,message);
    listenTo(mCtr);
    putInitialPanel(mCtr.getInitialComponent());
  }
}

Fixed version (ground truth):
/** 
 * Constructor for the contact form run controller
 * @param moduleConfiguration
 * @param ureq
 * @param wControl
 * @param coCourseNode
 */
public CORunController(ModuleConfiguration moduleConfiguration,UserRequest ureq,WindowControl wControl,UserCourseEnvironment userCourseEnv){
  super(ureq,wControl);
  cgm=userCourseEnv.getCourseEnvironment().getCourseGroupManager();
  areaManager=CoreSpringFactory.getImpl(BGAreaManager.class);
  businessGroupService=CoreSpringFactory.getImpl(BusinessGroupService.class);
  Translator fallback=Util.createPackageTranslator(ContactFormController.class,ureq.getLocale());
  setTranslator(Util.createPackageTranslator(CORunController.class,ureq.getLocale(),fallback));
  @SuppressWarnings("String_Node_Str") List<String> emailListConfig=(List<String>)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOADRESSES);
  String mSubject=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_MSUBJECT_DEFAULT);
  String mBody=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_MBODY_DEFAULT);
  Boolean partipsConfigured=moduleConfiguration.getBooleanEntry(COEditController.CONFIG_KEY_EMAILTOPARTICIPANTS);
  Boolean coachesConfigured=moduleConfiguration.getBooleanEntry(COEditController.CONFIG_KEY_EMAILTOCOACHES);
  Stack<ContactList> contactLists=new Stack<ContactList>();
  String grpNames=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOGROUPS);
  @SuppressWarnings("String_Node_Str") List<Long> groupKeys=(List<Long>)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOGROUP_IDS);
  if (groupKeys == null && StringHelper.containsNonWhitespace(grpNames)) {
    groupKeys=businessGroupService.toGroupKeys(grpNames,cgm.getCourseEntry());
  }
  if (coachesConfigured != null && coachesConfigured.booleanValue()) {
    ContactList cl=retrieveCoachesFromGroups(groupKeys);
    contactLists.push(cl);
  }
  if (partipsConfigured != null && partipsConfigured.booleanValue()) {
    ContactList cl=retrieveParticipantsFromGroups(groupKeys);
    contactLists.push(cl);
  }
  String areaNames=(String)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOAREAS);
  @SuppressWarnings("String_Node_Str") List<Long> areaKeys=(List<Long>)moduleConfiguration.get(COEditController.CONFIG_KEY_EMAILTOAREA_IDS);
  if (areaKeys == null && StringHelper.containsNonWhitespace(areaNames)) {
    areaKeys=areaManager.toAreaKeys(areaNames,cgm.getCourseResource());
  }
  if (coachesConfigured != null && coachesConfigured.booleanValue()) {
    ContactList cl=retrieveCoachesFromAreas(areaKeys);
    contactLists.push(cl);
  }
  if (partipsConfigured != null && partipsConfigured.booleanValue()) {
    ContactList cl=retrieveParticipantsFromAreas(areaKeys);
    contactLists.push(cl);
  }
  if (emailListConfig != null) {
    ContactList emailList=new ContactList(translate("String_Node_Str"));
    for (Iterator<String> iter=emailListConfig.iterator(); iter.hasNext(); ) {
      String email=iter.next();
      emailList.add(email);
    }
    contactLists.push(emailList);
  }
  if (contactLists.size() > 0) {
    ContactMessage cmsg=new ContactMessage(ureq.getIdentity());
    while (!contactLists.empty()) {
      ContactList cl=contactLists.pop();
      cmsg.addEmailTo(cl);
    }
    cmsg.setBodyText(mBody);
    cmsg.setSubject(mSubject);
    coFoCtr=new ContactFormController(ureq,getWindowControl(),false,false,false,cmsg);
    listenTo(coFoCtr);
    putInitialPanel(coFoCtr.getInitialComponent());
  }
 else {
    String message=translate("String_Node_Str");
    Controller mCtr=MessageUIFactory.createInfoMessage(ureq,getWindowControl(),null,message);
    listenTo(mCtr);
    putInitialPanel(mCtr.getInitialComponent());
  }
}