Program: 69545
Project: 69545
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected boolean validateFormLogic(UserRequest ureq){
  boolean createPublishSet=true;
  if (containsRunContextKey("String_Node_Str")) {
    createPublishSet=getFromRunContext("String_Node_Str") != multiSelectTree.getSelectedKeys();
  }
  if (createPublishSet && publishManager2.hasPublishableChanges()) {
    List<String> selectedKeys=new ArrayList<>(multiSelectTree.getSelectedKeys());
    for (Iterator<String> selectionIt=selectedKeys.iterator(); selectionIt.hasNext(); ) {
      String ident=selectionIt.next();
      TreeNode node=publishManager2.getPublishTreeModel().getNodeById(ident);
      if (!publishManager2.getPublishTreeModel().isSelectable(node)) {
        selectionIt.remove();
      }
    }
    List<String> asList=new ArrayList<String>(selectedKeys);
    publishManager2.createPublishSetFor(asList);
    addToRunContext("String_Node_Str",selectedKeys);
    PublishSetInformations set=publishProcess.testPublishSet(getLocale());
    sds=set.getWarnings();
    updateNotes=set.getUpdateInfos();
    addToRunContext("String_Node_Str",updateNotes);
    boolean isValid=sds.length == 0;
    if (isValid) {
      return true;
    }
    sds=StatusDescriptionHelper.sort(sds);
    String generalErrorTxt=null;
    String errorTxt=getTranslator().translate("String_Node_Str");
    String warningTxt=getTranslator().translate("String_Node_Str");
    String errors="String_Node_Str";
    int errCnt=0;
    String warnings="String_Node_Str";
    for (int i=0; i < sds.length; i++) {
      StatusDescription description=sds[i];
      String nodeId=sds[i].getDescriptionForUnit();
      if (nodeId == null) {
        generalErrorTxt=sds[i].getShortDescription(ureq.getLocale());
        break;
      }
      String nodeName=publishProcess.getCourseEditorTreeModel().getCourseNode(nodeId).getShortName();
      String isFor="String_Node_Str" + nodeName + "String_Node_Str";
      if (description.isError()) {
        errors+="String_Node_Str" + isFor + description.getShortDescription(ureq.getLocale())+ "String_Node_Str";
        errCnt++;
      }
 else       if (description.isWarning()) {
        warnings+="String_Node_Str" + isFor + description.getShortDescription(ureq.getLocale())+ "String_Node_Str";
      }
    }
    warnings+="String_Node_Str";
    errors+="String_Node_Str";
    errorTxt+="String_Node_Str" + errors;
    warningTxt+="String_Node_Str" + warnings;
    if (errCnt > 0) {
      return false;
    }
    if (generalErrorTxt != null) {
      addToRunContext("String_Node_Str",generalErrorTxt);
      errorElement.setValue(generalErrorTxt);
      errorElement.setVisible(true);
      return false;
    }
 else     if (errCnt > 0) {
      addToRunContext("String_Node_Str",errorTxt);
      errorElement.setValue(errorTxt);
      errorElement.setVisible(true);
      return false;
    }
 else {
      addToRunContext("String_Node_Str",warningTxt);
      return true;
    }
  }
 else {
    boolean retVal=!containsRunContextKey("String_Node_Str");
    retVal=retVal && !containsRunContextKey("String_Node_Str");
    return retVal;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected boolean validateFormLogic(UserRequest ureq){
  boolean createPublishSet=true;
  if (containsRunContextKey("String_Node_Str")) {
    createPublishSet=getFromRunContext("String_Node_Str") != multiSelectTree.getSelectedKeys();
  }
  if (createPublishSet && publishManager2.hasPublishableChanges()) {
    List<String> selectedKeys=new ArrayList<>(multiSelectTree.getSelectedKeys());
    for (Iterator<String> selectionIt=selectedKeys.iterator(); selectionIt.hasNext(); ) {
      String ident=selectionIt.next();
      TreeNode node=publishManager2.getPublishTreeModel().getNodeById(ident);
      if (!publishManager2.getPublishTreeModel().isSelectable(node)) {
        selectionIt.remove();
      }
    }
    List<String> asList=new ArrayList<String>(selectedKeys);
    publishManager2.createPublishSetFor(asList);
    addToRunContext("String_Node_Str",selectedKeys);
    PublishSetInformations set=publishProcess.testPublishSet(getLocale());
    sds=set.getWarnings();
    updateNotes=set.getUpdateInfos();
    addToRunContext("String_Node_Str",updateNotes);
    boolean isValid=sds.length == 0;
    if (isValid) {
      return true;
    }
    sds=StatusDescriptionHelper.sort(sds);
    String generalErrorTxt=null;
    String errorTxt=getTranslator().translate("String_Node_Str");
    String warningTxt=getTranslator().translate("String_Node_Str");
    String errors="String_Node_Str";
    int errCnt=0;
    String warnings="String_Node_Str";
    for (int i=0; i < sds.length; i++) {
      StatusDescription description=sds[i];
      String nodeId=sds[i].getDescriptionForUnit();
      if (nodeId == null) {
        generalErrorTxt=sds[i].getShortDescription(getLocale());
        break;
      }
      String nodeName=publishProcess.getCourseEditorTreeModel().getCourseNode(nodeId).getShortName();
      String isFor="String_Node_Str" + nodeName + "String_Node_Str";
      if (description.isError()) {
        errors+="String_Node_Str" + isFor + description.getShortDescription(getLocale())+ "String_Node_Str";
        errCnt++;
      }
 else       if (description.isWarning()) {
        warnings+="String_Node_Str" + isFor + description.getShortDescription(getLocale())+ "String_Node_Str";
      }
    }
    warnings+="String_Node_Str";
    errors+="String_Node_Str";
    errorTxt+="String_Node_Str" + errors;
    warningTxt+="String_Node_Str" + warnings;
    if (generalErrorTxt != null) {
      addToRunContext("String_Node_Str",generalErrorTxt);
      errorElement.setValue(generalErrorTxt);
      errorElement.setVisible(true);
      return false;
    }
 else     if (errCnt > 0) {
      addToRunContext("String_Node_Str",errorTxt);
      errorElement.setValue(errorTxt);
      errorElement.setVisible(true);
      return false;
    }
 else {
      addToRunContext("String_Node_Str",warningTxt);
      return true;
    }
  }
 else {
    boolean retVal=!containsRunContextKey("String_Node_Str");
    retVal=retVal && !containsRunContextKey("String_Node_Str");
    return retVal;
  }
}