Program: 69340
Project: 69340
Buggy source:
private void setupContent(UserRequest ureq,UserCourseEnvironment userCourseEnv,CourseNode courseNode){
  ModuleConfiguration config=courseNode.getModuleConfiguration();
  viewHighscore=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HIGHSCORE);
  if (!viewHighscore) {
    return;
  }
  Date start=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_DATESTART) != null ? (Date)config.get(HighScoreEditController.CONFIG_KEY_DATESTART) : null;
  if (start != null && start.after(new Date())) {
    viewHighscore=false;
    return;
  }
  if (ureq.getUserSession().getRoles().isGuestOnly()) {
    viewHighscore=false;
    return;
  }
  ownIdentity=userCourseEnv.getIdentityEnvironment().getIdentity();
  AssessmentManager assessmentManager=userCourseEnv.getCourseEnvironment().getAssessmentManager();
  AssessmentEntry ownEntry=assessmentManager.getAssessmentEntry(courseNode,ownIdentity);
  if (ownEntry != null && ownEntry.getUserVisibility() != null && !ownEntry.getUserVisibility().booleanValue()) {
    viewHighscore=false;
    return;
  }
  boolean adminORcoach=userCourseEnv.isAdmin() || userCourseEnv.isCoach();
  if (!adminORcoach && (ownEntry == null || (ownEntry != null && ownEntry.getScore() == null))) {
    viewHighscore=false;
    return;
  }
  List<AssessmentEntry> assessEntries;
  if ("String_Node_Str".equals(courseNode.getType())) {
    assessEntries=assessmentManager.getAssessmentEntriesWithStatus(courseNode,AssessmentEntryStatus.done);
  }
 else {
    assessEntries=assessmentManager.getAssessmentEntries(courseNode);
  }
  if (assessEntries == null || assessEntries.isEmpty()) {
    viewHighscore=false;
    return;
  }
  if (adminORcoach) {
    assessEntries.remove(ownEntry);
  }
  viewTable=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_LISTING);
  viewHistogram=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HISTOGRAM);
  viewPosition=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_POSITION);
  viewPodium=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_PODIUM);
  anonymous=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_ANONYMIZE);
  int bestOnly=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_BESTONLY) != null ? (int)config.get(HighScoreEditController.CONFIG_KEY_BESTONLY) : 0;
  tableSize=bestOnly != 0 ? (int)config.get(HighScoreEditController.CONFIG_KEY_NUMUSER) : assessEntries.size();
  initLists();
  lowerBorder=(Float)config.get(MSCourseNode.CONFIG_KEY_SCORE_MIN);
  upperBorder=(Float)config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
  highscoreDataModel=highScoreManager.sortRankByScore(assessEntries,allMembers,ownIdMembers,allPodium,ownIdIndices,tableSize,ownIdentity,userManager);
  allScores=highscoreDataModel.getScores();
  doLoadShowConfig(ureq);
  initForm(ureq);
}

Fixed version (ground truth):
private void setupContent(UserRequest ureq,UserCourseEnvironment userCourseEnv,CourseNode courseNode){
  ModuleConfiguration config=courseNode.getModuleConfiguration();
  viewHighscore=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HIGHSCORE);
  if (!viewHighscore) {
    return;
  }
  Date start=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_DATESTART) != null ? (Date)config.get(HighScoreEditController.CONFIG_KEY_DATESTART) : null;
  if (start != null && start.after(new Date())) {
    viewHighscore=false;
    return;
  }
  if (ureq.getUserSession().getRoles().isGuestOnly()) {
    viewHighscore=false;
    return;
  }
  ownIdentity=userCourseEnv.getIdentityEnvironment().getIdentity();
  AssessmentManager assessmentManager=userCourseEnv.getCourseEnvironment().getAssessmentManager();
  AssessmentEntry ownEntry=assessmentManager.getAssessmentEntry(courseNode,ownIdentity);
  if (ownEntry != null && ownEntry.getUserVisibility() != null && !ownEntry.getUserVisibility().booleanValue()) {
    viewHighscore=false;
    return;
  }
  boolean adminORcoach=userCourseEnv.isAdmin() || userCourseEnv.isCoach();
  if (!adminORcoach && (ownEntry == null || (ownEntry != null && ownEntry.getScore() == null))) {
    viewHighscore=false;
    return;
  }
  List<AssessmentEntry> assessEntries;
  if ("String_Node_Str".equals(courseNode.getType())) {
    assessEntries=assessmentManager.getAssessmentEntriesWithStatus(courseNode,AssessmentEntryStatus.done);
  }
 else {
    assessEntries=assessmentManager.getAssessmentEntries(courseNode);
  }
  if (assessEntries != null && adminORcoach) {
    assessEntries.remove(ownEntry);
  }
  if (assessEntries == null || assessEntries.isEmpty()) {
    viewHighscore=false;
    return;
  }
  viewTable=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_LISTING);
  viewHistogram=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HISTOGRAM);
  viewPosition=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_POSITION);
  viewPodium=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_PODIUM);
  anonymous=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_ANONYMIZE);
  int bestOnly=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_BESTONLY) != null ? (int)config.get(HighScoreEditController.CONFIG_KEY_BESTONLY) : 0;
  tableSize=bestOnly != 0 ? (int)config.get(HighScoreEditController.CONFIG_KEY_NUMUSER) : assessEntries.size();
  initLists();
  lowerBorder=(Float)config.get(MSCourseNode.CONFIG_KEY_SCORE_MIN);
  upperBorder=(Float)config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
  highscoreDataModel=highScoreManager.sortRankByScore(assessEntries,allMembers,ownIdMembers,allPodium,ownIdIndices,tableSize,ownIdentity,userManager);
  allScores=highscoreDataModel.getScores();
  doLoadShowConfig(ureq);
  initForm(ureq);
}