Program: 69743
Project: 69743
Buggy source:
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  FormUIFactory formFactory=FormUIFactory.getInstance();
  I18nManager i18nMgr=I18nManager.getInstance();
  Preferences guiPrefs=ureq.getUserSession().getGuiPreferences();
  this.flc.contextPut("String_Node_Str",referenceLocale.toString());
  this.flc.contextPut("String_Node_Str",i18nMgr.getLanguageTranslated(referenceLocale.toString(),false));
  List<String> bundlesList=new ArrayList<String>();
  List<String> keysList=new ArrayList<String>();
  for (  I18nItem item : i18nItems) {
    if (!bundlesList.contains(item.getBundleName())) {
      bundlesList.add(item.getBundleName());
    }
    if (currentItem.getBundleName().equals(item.getBundleName())) {
      keysList.add(item.getKey());
    }
  }
  String[] bundlesListArray=ArrayHelper.toArray(bundlesList);
  String[] keysListArray=ArrayHelper.toArray(keysList);
  bundlesSelection=formFactory.addDropdownSingleselect("String_Node_Str",this.flc,bundlesListArray,bundlesListArray,null);
  bundlesSelection.addActionListener(this,FormEvent.ONCHANGE);
  bundlesSelection.select(currentItem.getBundleName(),true);
  keysSelection=formFactory.addDropdownSingleselect("String_Node_Str",this.flc,keysListArray,keysListArray,null);
  keysSelection.addActionListener(this,FormEvent.ONCHANGE);
  keysSelection.select(currentItem.getKey(),true);
  referenceArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  referenceArea.setEnabled(false);
  Boolean compareEnabledPrefs=(Boolean)guiPrefs.get(I18nModule.class,I18nModule.GUI_PREFS_COMPARE_LANG_ENABLED,Boolean.FALSE);
  compareArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  compareArea.setEnabled(false);
  compareArea.setVisible(compareEnabledPrefs.booleanValue());
  compareSwitch=formFactory.addCheckboxesHorizontal("String_Node_Str",null,this.flc,new String[]{KEYS_ENABLED},new String[]{KEYS_EMPTY},null);
  compareSwitch.select(KEYS_ENABLED,compareEnabledPrefs.booleanValue());
  compareSwitch.addActionListener(listener,FormEvent.ONCLICK);
  formLayout.add(compareSwitch);
  this.flc.contextPut("String_Node_Str",compareEnabledPrefs);
  Set<String> availableLangKeys=I18nModule.getAvailableLanguageKeys();
  String[] comparelangKeys=ArrayHelper.toArray(availableLangKeys);
  String[] compareLangValues=new String[comparelangKeys.length];
  for (int i=0; i < comparelangKeys.length; i++) {
    String key=comparelangKeys[i];
    String explLang=i18nMgr.getLanguageInEnglish(key,customizingMode);
    String all=explLang;
    if (explLang != null && !explLang.equals(key))     all+="String_Node_Str" + key + "String_Node_Str";
    compareLangValues[i]=all;
  }
  ArrayHelper.sort(comparelangKeys,compareLangValues,false,true,false);
  String[] compareLangCssClasses=i18nMgr.createLanguageFlagsCssClasses(comparelangKeys,"String_Node_Str");
  String comparePrefs=(String)guiPrefs.get(I18nModule.class,I18nModule.GUI_PREFS_PREFERRED_COMPARE_LANG,I18nModule.getDefaultLocale().toString());
  compareLocale=i18nMgr.getLocaleOrNull(comparePrefs);
  if (compareLocale == null)   compareLocale=I18nModule.getDefaultLocale();
  compareLangSelection=formFactory.addDropdownSingleselect("String_Node_Str",this.flc,comparelangKeys,compareLangValues,compareLangCssClasses);
  compareLangSelection.select(i18nMgr.getLocaleKey(compareLocale),true);
  this.flc.contextPut("String_Node_Str",i18nMgr.getLocaleKey(compareLocale));
  compareLangSelection.addActionListener(this,FormEvent.ONCHANGE);
  compareLangSelection.setEnabled(compareEnabledPrefs.booleanValue());
  this.flc.contextPut("String_Node_Str",i18nMgr.getLocaleKey(currentItem.getLocale()));
  this.flc.contextPut("String_Node_Str",i18nMgr.getLanguageTranslated(i18nMgr.getLocaleKey(currentItem.getLocale()),false));
  targetArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  annotationArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  progressBarBundle=new ProgressBar("String_Node_Str",200,1,bundlesList.size(),translate("String_Node_Str"));
  progressBarBundle.setPercentagesEnabled(false);
  this.flc.put("String_Node_Str",progressBarBundle);
  progressBarKey=new ProgressBar("String_Node_Str",200,1,keysList.size(),translate("String_Node_Str"));
  progressBarKey.setPercentagesEnabled(false);
  this.flc.put("String_Node_Str",progressBarKey);
  previousLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(previousLink);
  saveLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(saveLink);
  saveNextLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(saveNextLink);
  nextLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(nextLink);
  initOrUpdateCurrentItem(ureq);
  if (customizingMode) {
    annotationArea.setEnabled(false);
    Locale origLocale=I18nModule.getAllLocales().get(i18nMgr.createOrigianlLocaleKeyForOverlay(currentItem.getLocale()));
    if (origLocale == null) {
      origLocale=currentItem.getLocale();
    }
    String localeKey=i18nMgr.getLocaleKey(origLocale);
    flc.contextPut("String_Node_Str",localeKey);
    flc.contextPut("String_Node_Str",i18nMgr.getLanguageTranslated(localeKey,true));
  }
  flc.contextPut("String_Node_Str",Boolean.valueOf(customizingMode));
  flc.contextPut("String_Node_Str",(customizingMode ? "String_Node_Str" : "String_Node_Str"));
}

Fixed version (ground truth):
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  FormUIFactory formFactory=FormUIFactory.getInstance();
  I18nManager i18nMgr=I18nManager.getInstance();
  Preferences guiPrefs=ureq.getUserSession().getGuiPreferences();
  flc.contextPut("String_Node_Str",referenceLocale.toString());
  flc.contextPut("String_Node_Str",i18nMgr.getLanguageTranslated(referenceLocale.toString(),false));
  List<String> bundlesList=new ArrayList<String>();
  List<String> keysList=new ArrayList<String>();
  for (  I18nItem item : i18nItems) {
    if (!bundlesList.contains(item.getBundleName())) {
      bundlesList.add(item.getBundleName());
    }
    if (currentItem.getBundleName().equals(item.getBundleName())) {
      keysList.add(item.getKey());
    }
  }
  String[] bundlesListArray=ArrayHelper.toArray(bundlesList);
  String[] keysListArray=ArrayHelper.toArray(keysList);
  bundlesSelection=formFactory.addDropdownSingleselect("String_Node_Str",this.flc,bundlesListArray,bundlesListArray,null);
  bundlesSelection.addActionListener(this,FormEvent.ONCHANGE);
  bundlesSelection.select(currentItem.getBundleName(),true);
  keysSelection=formFactory.addDropdownSingleselect("String_Node_Str",this.flc,keysListArray,keysListArray,null);
  keysSelection.addActionListener(this,FormEvent.ONCHANGE);
  keysSelection.select(currentItem.getKey(),true);
  referenceArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  referenceArea.setEnabled(false);
  Boolean compareEnabledPrefs=(Boolean)guiPrefs.get(I18nModule.class,I18nModule.GUI_PREFS_COMPARE_LANG_ENABLED,Boolean.FALSE);
  compareArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  compareArea.setEnabled(false);
  compareArea.setVisible(compareEnabledPrefs.booleanValue());
  compareSwitch=formFactory.addCheckboxesHorizontal("String_Node_Str",null,this.flc,new String[]{KEYS_ENABLED},new String[]{KEYS_EMPTY},null);
  compareSwitch.select(KEYS_ENABLED,compareEnabledPrefs.booleanValue());
  compareSwitch.addActionListener(listener,FormEvent.ONCLICK);
  formLayout.add(compareSwitch);
  this.flc.contextPut("String_Node_Str",compareEnabledPrefs);
  Set<String> availableLangKeys=I18nModule.getAvailableLanguageKeys();
  String[] comparelangKeys=ArrayHelper.toArray(availableLangKeys);
  String[] compareLangValues=new String[comparelangKeys.length];
  for (int i=0; i < comparelangKeys.length; i++) {
    String key=comparelangKeys[i];
    String explLang=i18nMgr.getLanguageInEnglish(key,customizingMode);
    String all=explLang;
    if (explLang != null && !explLang.equals(key))     all+="String_Node_Str" + key + "String_Node_Str";
    compareLangValues[i]=all;
  }
  ArrayHelper.sort(comparelangKeys,compareLangValues,false,true,false);
  String[] compareLangCssClasses=i18nMgr.createLanguageFlagsCssClasses(comparelangKeys,"String_Node_Str");
  String comparePrefs=(String)guiPrefs.get(I18nModule.class,I18nModule.GUI_PREFS_PREFERRED_COMPARE_LANG,I18nModule.getDefaultLocale().toString());
  compareLocale=i18nMgr.getLocaleOrNull(comparePrefs);
  if (compareLocale == null)   compareLocale=I18nModule.getDefaultLocale();
  compareLangSelection=formFactory.addDropdownSingleselect("String_Node_Str",this.flc,comparelangKeys,compareLangValues,compareLangCssClasses);
  compareLangSelection.select(i18nMgr.getLocaleKey(compareLocale),true);
  this.flc.contextPut("String_Node_Str",i18nMgr.getLocaleKey(compareLocale));
  compareLangSelection.addActionListener(this,FormEvent.ONCHANGE);
  compareLangSelection.setEnabled(compareEnabledPrefs.booleanValue());
  this.flc.contextPut("String_Node_Str",i18nMgr.getLocaleKey(currentItem.getLocale()));
  this.flc.contextPut("String_Node_Str",i18nMgr.getLanguageTranslated(i18nMgr.getLocaleKey(currentItem.getLocale()),false));
  targetArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  annotationArea=formFactory.addTextAreaElement("String_Node_Str","String_Node_Str",-1,1,-1,true,null,this.flc);
  progressBarBundle=new ProgressBar("String_Node_Str",200,1,bundlesList.size(),translate("String_Node_Str"));
  progressBarBundle.setPercentagesEnabled(false);
  this.flc.put("String_Node_Str",progressBarBundle);
  progressBarKey=new ProgressBar("String_Node_Str",200,1,keysList.size(),translate("String_Node_Str"));
  progressBarKey.setPercentagesEnabled(false);
  this.flc.put("String_Node_Str",progressBarKey);
  previousLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(previousLink);
  saveLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(saveLink);
  saveNextLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(saveNextLink);
  nextLink=new FormLinkImpl("String_Node_Str","String_Node_Str","String_Node_Str",Link.BUTTON);
  formLayout.add(nextLink);
  initOrUpdateCurrentItem(ureq);
  if (customizingMode) {
    annotationArea.setEnabled(false);
    Locale origLocale=I18nModule.getAllLocales().get(i18nMgr.createOrigianlLocaleKeyForOverlay(currentItem.getLocale()));
    if (origLocale == null) {
      origLocale=currentItem.getLocale();
    }
    String localeKey=i18nMgr.getLocaleKey(origLocale);
    flc.contextPut("String_Node_Str",localeKey);
    flc.contextPut("String_Node_Str",i18nMgr.getLanguageTranslated(localeKey,true));
  }
  flc.contextPut("String_Node_Str",Boolean.valueOf(customizingMode));
  flc.contextPut("String_Node_Str",(customizingMode ? "String_Node_Str" : "String_Node_Str"));
}