Program: 69322
Project: 69322
Buggy source:
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  VelocityContainer mainVC=this.flc.getFormItemComponent();
  mainVC.put("String_Node_Str",new StatisticsComponent("String_Node_Str"));
  if (viewHistogram) {
    VelocityContainer scoreHistogramVC=createVelocityContainer("String_Node_Str");
    HighScoreRankingResults modifiedData=highScoreManager.processHistogramData(allScores,lowerBorder,upperBorder);
    allScores=modifiedData.getModifiedScores();
    scoreHistogramVC.contextPut("String_Node_Str",BarSeries.datasToString(allScores));
    scoreHistogramVC.contextPut("String_Node_Str",ownIdIndices.size() > 0 ? highScoreManager.calculateHistogramCutvalue(allMembers.get(ownIdIndices.get(0)).getScore(),modifiedData.getClasswidth(),modifiedData.getMin()) : -1000);
    long classwidth=modifiedData.getClasswidth();
    scoreHistogramVC.contextPut("String_Node_Str",classwidth);
    UserAvatarMapper mapper=new UserAvatarMapper(false);
    String mapperPath=registerMapper(ureq,mapper);
    String identityMapperPath=mapper.createPathFor(mapperPath,ownIdentity);
    scoreHistogramVC.contextPut("String_Node_Str",identityMapperPath);
    mainVC.put("String_Node_Str",scoreHistogramVC);
  }
  if (viewPodium) {
    String[] localizer={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int maxPerson=6;
    boolean showPortraits=!anonymous && allPodium.get(0).size() <= maxPerson && allPodium.get(1).size() <= maxPerson && allPodium.get(2).size() <= maxPerson;
    for (int i=0; i < localizer.length; i++) {
      int sizePerPos=allPodium.get(i).size();
      StringBuilder sb=new StringBuilder();
      if (sizePerPos > 2) {
        int reduce=0;
        if (allPodium.get(i).get(0).getIdentity().equals(ownIdentity)) {
          sb.append(userManager.getUserDisplayName(ownIdentity));
          ++reduce;
        }
        if (sizePerPos > 6 || anonymous) {
          mainVC.contextPut("String_Node_Str" + (i + 1),(sizePerPos - reduce) + "String_Node_Str" + (reduce == 1 ? translate("String_Node_Str") : translate("String_Node_Str")));
        }
 else {
          links[i]=LinkFactory.createLink(null,"String_Node_Str" + (i + 1),"String_Node_Str",(sizePerPos - reduce) + "String_Node_Str" + (reduce == 1 ? translate("String_Node_Str") : translate("String_Node_Str")),getTranslator(),mainVC,this,16);
        }
      }
 else {
        for (        HighScoreTableEntry te : allPodium.get(i)) {
          if (!anonymous || te.getIdentity().equals(ownIdentity)) {
            sb.append(userManager.getUserDisplayName(te.getIdentity()));
            sb.append("String_Node_Str");
          }
        }
      }
      mainVC.contextPut(localizer[i],sizePerPos > 0 ? sb.toString() : translate("String_Node_Str"));
      mainVC.contextPut("String_Node_Str" + (i + 1),sizePerPos > 0 ? allPodium.get(i).get(0).getScore() : null);
      if (sizePerPos > 0 && showPortraits) {
        mainVC.contextPut("String_Node_Str" + (i + 1),sizePerPos);
        for (int j=0; j < sizePerPos; j++) {
          Identity currentID=allPodium.get(i).get(j).getIdentity();
          boolean choosePortrait=!anonymous || ownIdentity.equals(currentID);
          DisplayPortraitController portrait=new DisplayPortraitController(ureq,getWindowControl(),currentID,false,choosePortrait,!choosePortrait);
          Component portraitComponent=portrait.getInitialComponent();
          mainVC.put("String_Node_Str" + (i + 1) + "String_Node_Str"+ (j + 1),portraitComponent);
        }
      }
 else {
        for (int j=0; j < sizePerPos; j++) {
          Identity currentID=allPodium.get(i).get(j).getIdentity();
          if (ownIdentity.equals(currentID)) {
            DisplayPortraitController portrait=new DisplayPortraitController(ureq,getWindowControl(),currentID,true,true,false);
            mainVC.put("String_Node_Str" + (i + 1),portrait.getInitialComponent());
          }
        }
      }
    }
  }
  if (viewTable) {
    FlexiTableColumnModel tableColumnModel=FlexiTableDataModelFactory.createFlexiTableColumnModel();
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("String_Node_Str",HighScoreTableEntry.RANK));
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("String_Node_Str",HighScoreTableEntry.SCORE));
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("String_Node_Str",HighScoreTableEntry.NAME));
    if (tableSize < allMembers.size()) {
      allMembers.subList(tableSize,allMembers.size()).clear();
    }
    tableDataModel=new FlexiTableDataModelImpl<HighScoreTableEntry>(new HighScoreFlexiTableModel(allMembers,anonymous,translate("String_Node_Str"),ownIdentity),tableColumnModel);
    FlexiTableElement topTenTable=uifactory.addTableElement(getWindowControl(),"String_Node_Str",tableDataModel,getTranslator(),formLayout);
    topTenTable.setNumOfRowsEnabled(false);
    topTenTable.setCustomizeColumns(false);
    topTenTable.setCssDelegate(new MarkedMemberCssDelegate(false));
    if (!ownIdMembers.isEmpty()) {
      tableDataModel2=new FlexiTableDataModelImpl<HighScoreTableEntry>(new HighScoreFlexiTableModel(ownIdMembers,anonymous,translate("String_Node_Str"),ownIdentity),tableColumnModel);
      FlexiTableElement tableElement=uifactory.addTableElement(getWindowControl(),"String_Node_Str",tableDataModel2,getTranslator(),formLayout);
      tableElement.setNumOfRowsEnabled(false);
      tableElement.setCustomizeColumns(false);
      tableElement.setCssDelegate(new MarkedMemberCssDelegate(true));
    }
  }
  if (viewPosition && ownIdIndices.size() > 0) {
    mainVC.contextPut("String_Node_Str",translate("String_Node_Str",new String[]{String.valueOf(highscoreDataModel.getOwnTableEntry().getRank()),String.valueOf(allScores.length - ownIdIndices.get(0))}));
  }
}

Fixed version (ground truth):
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  VelocityContainer mainVC=this.flc.getFormItemComponent();
  mainVC.put("String_Node_Str",new StatisticsComponent("String_Node_Str"));
  if (viewHistogram) {
    VelocityContainer scoreHistogramVC=createVelocityContainer("String_Node_Str");
    HighScoreRankingResults modifiedData=highScoreManager.processHistogramData(allScores,lowerBorder,upperBorder);
    allScores=modifiedData.getModifiedScores();
    scoreHistogramVC.contextPut("String_Node_Str",BarSeries.datasToString(allScores));
    scoreHistogramVC.contextPut("String_Node_Str",ownIdIndices.size() > 0 ? highScoreManager.calculateHistogramCutvalue(allMembers.get(ownIdIndices.get(0)).getScore(),modifiedData.getClasswidth(),modifiedData.getMin()) : -1000);
    long classwidth=modifiedData.getClasswidth();
    scoreHistogramVC.contextPut("String_Node_Str",classwidth);
    UserAvatarMapper mapper=new UserAvatarMapper(false);
    String mapperPath=registerMapper(ureq,mapper);
    String identityMapperPath=mapper.createPathFor(mapperPath,ownIdentity);
    scoreHistogramVC.contextPut("String_Node_Str",identityMapperPath);
    mainVC.put("String_Node_Str",scoreHistogramVC);
  }
  if (viewPodium) {
    String[] localizer={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int maxPerson=6;
    boolean showPortraits=!anonymous && allPodium.get(0).size() <= maxPerson && allPodium.get(1).size() <= maxPerson && allPodium.get(2).size() <= maxPerson;
    for (int i=0; i < localizer.length; i++) {
      int sizePerPos=allPodium.get(i).size();
      StringBuilder sb=new StringBuilder();
      if (sizePerPos > 2) {
        int reduce=0;
        if (allPodium.get(i).get(0).getIdentity().equals(ownIdentity)) {
          sb.append(userManager.getUserDisplayName(ownIdentity));
          ++reduce;
        }
        if (sizePerPos > 6 || anonymous) {
          mainVC.contextPut("String_Node_Str" + (i + 1),(sizePerPos - reduce) + "String_Node_Str" + (reduce == 1 ? translate("String_Node_Str") : translate("String_Node_Str")));
        }
 else {
          links[i]=LinkFactory.createLink(null,"String_Node_Str" + (i + 1),"String_Node_Str",(sizePerPos - reduce) + "String_Node_Str" + (reduce == 1 ? translate("String_Node_Str") : translate("String_Node_Str")),getTranslator(),mainVC,this,16);
        }
      }
 else {
        for (        HighScoreTableEntry te : allPodium.get(i)) {
          if (!anonymous || te.getIdentity().equals(ownIdentity)) {
            sb.append(userManager.getUserDisplayName(te.getIdentity()));
            sb.append("String_Node_Str");
          }
        }
      }
      mainVC.contextPut(localizer[i],sizePerPos > 0 ? sb.toString() : translate("String_Node_Str"));
      mainVC.contextPut("String_Node_Str" + (i + 1),sizePerPos > 0 ? allPodium.get(i).get(0).getScore() : null);
      if (sizePerPos > 0 && showPortraits) {
        mainVC.contextPut("String_Node_Str" + (i + 1),sizePerPos);
        for (int j=0; j < sizePerPos; j++) {
          Identity currentID=allPodium.get(i).get(j).getIdentity();
          boolean choosePortrait=!anonymous || ownIdentity.equals(currentID);
          DisplayPortraitController portrait=new DisplayPortraitController(ureq,getWindowControl(),currentID,false,choosePortrait,!choosePortrait);
          Component portraitComponent=portrait.getInitialComponent();
          mainVC.put("String_Node_Str" + (i + 1) + "String_Node_Str"+ (j + 1),portraitComponent);
        }
      }
 else {
        for (int j=0; j < sizePerPos; j++) {
          Identity currentID=allPodium.get(i).get(j).getIdentity();
          if (ownIdentity.equals(currentID)) {
            DisplayPortraitController portrait=new DisplayPortraitController(ureq,getWindowControl(),currentID,true,true,false);
            mainVC.put("String_Node_Str" + (i + 1),portrait.getInitialComponent());
          }
        }
      }
    }
  }
  if (viewTable) {
    FlexiTableColumnModel tableColumnModel=FlexiTableDataModelFactory.createFlexiTableColumnModel();
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("String_Node_Str",HighScoreTableEntry.RANK));
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("String_Node_Str",HighScoreTableEntry.SCORE));
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("String_Node_Str",HighScoreTableEntry.NAME));
    if (tableSize < allMembers.size()) {
      allMembers.subList(tableSize,allMembers.size()).clear();
    }
    tableDataModel=new FlexiTableDataModelImpl<HighScoreTableEntry>(new HighScoreFlexiTableModel(allMembers,anonymous,translate("String_Node_Str"),ownIdentity),tableColumnModel);
    FlexiTableElement topTenTable=uifactory.addTableElement(getWindowControl(),"String_Node_Str",tableDataModel,getTranslator(),formLayout);
    topTenTable.setNumOfRowsEnabled(false);
    topTenTable.setCustomizeColumns(false);
    topTenTable.setCssDelegate(new MarkedMemberCssDelegate(false));
    if (!ownIdMembers.isEmpty()) {
      tableDataModel2=new FlexiTableDataModelImpl<HighScoreTableEntry>(new HighScoreFlexiTableModel(ownIdMembers,anonymous,translate("String_Node_Str"),ownIdentity),tableColumnModel);
      FlexiTableElement tableElement=uifactory.addTableElement(getWindowControl(),"String_Node_Str",tableDataModel2,getTranslator(),formLayout);
      tableElement.setNumOfRowsEnabled(false);
      tableElement.setCustomizeColumns(false);
      tableElement.setCssDelegate(new MarkedMemberCssDelegate(true));
    }
  }
  if (viewPosition && ownIdIndices.size() > 0) {
    mainVC.contextPut("String_Node_Str",translate("String_Node_Str",new String[]{String.valueOf(highscoreDataModel.getOwnTableEntry().getRank()),String.valueOf(allScores.length - ownIdIndices.get(0) - 1)}));
  }
}