Program: 62835
Project: 62835
Buggy source:
/** 
 * Returns the links of actions available for a specific evaluation
 * @param session The Evaluation details
 * @param position The position of the evaluation in the table (to be used for rowID)
 * @param isHome Flag whether the link is to be put at homepage (to determine the redirect link in delete / publish)
 * @return
 * @throws EntityDoesNotExistException 
 */
public String getInstructorFeedbackSessionActions(FeedbackSessionAttributes session,boolean isHome,InstructorAttributes instructor,List<String> sectionsInCourse) throws EntityDoesNotExistException {
  StringBuilder result=new StringBuilder();
  boolean hasSubmit=session.isVisible() || session.isPrivateSession();
  boolean hasPublish=!session.isWaitingToOpen() && !session.isPublished();
  boolean hasUnpublish=!session.isWaitingToOpen() && session.isPublished();
  boolean hasRemind=session.isOpened();
  String disabledStr="String_Node_Str";
  String disableEditSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disableDeleteSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disableUnpublishSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disablePublishSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disableRemindSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  boolean shouldEnableSubmitLink=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS);
  for (  String section : sectionsInCourse) {
    if (instructor.isAllowedForPrivilege(section,session.feedbackSessionName,Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)) {
      shouldEnableSubmitLink=true;
      break;
    }
  }
  String disableSubmitSessionStr=shouldEnableSubmitLink ? "String_Node_Str" : disabledStr;
  result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionResultsLink(session.courseId,session.feedbackSessionName) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_RESULTS+ "String_Node_Str"+ "String_Node_Str");
  result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionEditLink(session.courseId,session.feedbackSessionName) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_EDIT+ "String_Node_Str"+ disableEditSessionStr+ "String_Node_Str");
  result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionDeleteLink(session.courseId,session.feedbackSessionName,(isHome ? Const.ActionURIs.INSTRUCTOR_HOME_PAGE : Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE)) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_DELETE+ "String_Node_Str"+ "String_Node_Str"+ session.courseId+ "String_Node_Str"+ session.feedbackSessionName+ "String_Node_Str"+ disableDeleteSessionStr+ "String_Node_Str");
  result.append("String_Node_Str" + (hasSubmit ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorFeedbackSessionSubmitLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_SUBMIT+ "String_Node_Str"+ disableSubmitSessionStr+ "String_Node_Str");
  if (session.isPrivateSession()) {
    return result.toString();
  }
  result.append("String_Node_Str" + (hasRemind ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorFeedbackSessionRemindLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_REMIND+ "String_Node_Str"+ (hasRemind ? "String_Node_Str" + session.feedbackSessionName + "String_Node_Str" : "String_Node_Str")+ disableRemindSessionStr+ "String_Node_Str"+ "String_Node_Str"+ disableRemindSessionStr+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ getInstructorFeedbackSessionRemindLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_REMIND+ "String_Node_Str"+ (hasRemind ? "String_Node_Str" + session.feedbackSessionName + "String_Node_Str" : "String_Node_Str")+ disableRemindSessionStr+ "String_Node_Str"+ "String_Node_Str"+ getInstructorFeedbackSessionRemindParticularStudentsPageLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ disableRemindSessionStr+ "String_Node_Str"+ session.courseId+ "String_Node_Str"+ session.feedbackSessionName+ "String_Node_Str"+ "String_Node_Str");
  if (hasUnpublish) {
    result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionUnpublishLink(session.courseId,session.feedbackSessionName,isHome) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_UNPUBLISH+ "String_Node_Str"+ "String_Node_Str"+ session.feedbackSessionName+ "String_Node_Str"+ disableUnpublishSessionStr+ "String_Node_Str");
  }
 else {
    result.append("String_Node_Str" + (hasPublish ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorFeedbackSessionPublishLink(session.courseId,session.feedbackSessionName,isHome)+ "String_Node_Str"+ "String_Node_Str"+ (hasPublish ? Const.Tooltips.FEEDBACK_SESSION_PUBLISH : Const.Tooltips.FEEDBACK_SESSION_AWAITING)+ "String_Node_Str"+ "String_Node_Str"+ (hasPublish ? "String_Node_Str" + session.feedbackSessionName + "String_Node_Str" : "String_Node_Str")+ disablePublishSessionStr+ "String_Node_Str");
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Returns the links of actions available for a specific evaluation
 * @param session The Evaluation details
 * @param position The position of the evaluation in the table (to be used for rowID)
 * @param isHome Flag whether the link is to be put at homepage (to determine the redirect link in delete / publish)
 * @return
 * @throws EntityDoesNotExistException 
 */
public String getInstructorFeedbackSessionActions(FeedbackSessionAttributes session,boolean isHome,InstructorAttributes instructor,List<String> sectionsInCourse) throws EntityDoesNotExistException {
  StringBuilder result=new StringBuilder();
  boolean hasSubmit=session.isVisible() || session.isPrivateSession();
  boolean hasPublish=!session.isWaitingToOpen() && !session.isPublished();
  boolean hasUnpublish=!session.isWaitingToOpen() && session.isPublished();
  boolean hasRemind=session.isOpened();
  String disabledStr="String_Node_Str";
  String disableEditSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disableDeleteSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disableUnpublishSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disablePublishSessionStr=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) ? "String_Node_Str" : disabledStr;
  String disableRemindSessionStr=(instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) && hasRemind) ? "String_Node_Str" : disabledStr;
  boolean shouldEnableSubmitLink=instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS);
  for (  String section : sectionsInCourse) {
    if (instructor.isAllowedForPrivilege(section,session.feedbackSessionName,Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)) {
      shouldEnableSubmitLink=true;
      break;
    }
  }
  String disableSubmitSessionStr=shouldEnableSubmitLink ? "String_Node_Str" : disabledStr;
  result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionResultsLink(session.courseId,session.feedbackSessionName) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_RESULTS+ "String_Node_Str"+ "String_Node_Str");
  result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionEditLink(session.courseId,session.feedbackSessionName) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_EDIT+ "String_Node_Str"+ disableEditSessionStr+ "String_Node_Str");
  result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionDeleteLink(session.courseId,session.feedbackSessionName,(isHome ? Const.ActionURIs.INSTRUCTOR_HOME_PAGE : Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE)) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_DELETE+ "String_Node_Str"+ "String_Node_Str"+ session.courseId+ "String_Node_Str"+ session.feedbackSessionName+ "String_Node_Str"+ disableDeleteSessionStr+ "String_Node_Str");
  result.append("String_Node_Str" + (hasSubmit ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorFeedbackSessionSubmitLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_SUBMIT+ "String_Node_Str"+ disableSubmitSessionStr+ "String_Node_Str");
  if (session.isPrivateSession()) {
    return result.toString();
  }
  result.append("String_Node_Str" + ((instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) && hasRemind) ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorFeedbackSessionRemindLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_REMIND+ "String_Node_Str"+ ((instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) && hasRemind) ? "String_Node_Str" + session.feedbackSessionName + "String_Node_Str" : "String_Node_Str")+ disableRemindSessionStr+ "String_Node_Str"+ "String_Node_Str"+ disableRemindSessionStr+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ getInstructorFeedbackSessionRemindLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_REMIND+ "String_Node_Str"+ (hasRemind ? "String_Node_Str" + session.feedbackSessionName + "String_Node_Str" : "String_Node_Str")+ disableRemindSessionStr+ "String_Node_Str"+ "String_Node_Str"+ getInstructorFeedbackSessionRemindParticularStudentsPageLink(session.courseId,session.feedbackSessionName)+ "String_Node_Str"+ "String_Node_Str"+ disableRemindSessionStr+ "String_Node_Str"+ session.courseId+ "String_Node_Str"+ session.feedbackSessionName+ "String_Node_Str"+ "String_Node_Str");
  if (hasUnpublish) {
    result.append("String_Node_Str" + "String_Node_Str" + getInstructorFeedbackSessionUnpublishLink(session.courseId,session.feedbackSessionName,isHome) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.FEEDBACK_SESSION_UNPUBLISH+ "String_Node_Str"+ "String_Node_Str"+ session.feedbackSessionName+ "String_Node_Str"+ disableUnpublishSessionStr+ "String_Node_Str");
  }
 else {
    result.append("String_Node_Str" + (hasPublish ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorFeedbackSessionPublishLink(session.courseId,session.feedbackSessionName,isHome)+ "String_Node_Str"+ "String_Node_Str"+ (hasPublish ? Const.Tooltips.FEEDBACK_SESSION_PUBLISH : Const.Tooltips.FEEDBACK_SESSION_AWAITING)+ "String_Node_Str"+ "String_Node_Str"+ (hasPublish ? "String_Node_Str" + session.feedbackSessionName + "String_Node_Str" : "String_Node_Str")+ disablePublishSessionStr+ "String_Node_Str");
  }
  return result.toString();
}