Program: 62836
Project: 62836
Buggy source:
/** 
 * Returns the links of actions available for a specific evaluation
 * @param eval 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
 */
public String getInstructorEvaluationActions(EvaluationAttributes eval,boolean isHome,InstructorAttributes instructor){
  StringBuilder result=new StringBuilder();
  boolean hasView=false;
  boolean hasEdit=false;
  boolean hasRemind=false;
  boolean hasPublish=false;
  boolean hasUnpublish=false;
switch (eval.getStatus()) {
case AWAITING:
    hasView=true;
  hasEdit=true;
break;
case OPEN:
hasView=true;
hasEdit=true;
hasRemind=true;
break;
case CLOSED:
hasView=true;
hasEdit=true;
hasPublish=true;
break;
case PUBLISHED:
hasUnpublish=true;
hasView=true;
break;
default :
Assumption.fail("String_Node_Str" + eval.getStatus());
break;
}
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;
result.append("String_Node_Str" + (hasView ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationResultsLink(eval.courseId,eval.name)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_RESULTS+ "String_Node_Str"+ "String_Node_Str");
result.append("String_Node_Str" + (hasEdit ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationEditLink(eval.courseId,eval.name)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_EDIT+ "String_Node_Str"+ disableEditSessionStr+ "String_Node_Str");
result.append("String_Node_Str" + "String_Node_Str" + getInstructorEvaluationPreviewLink(eval.courseId,eval.name) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_PREVIEW+ "String_Node_Str"+ "String_Node_Str");
result.append("String_Node_Str" + "String_Node_Str" + getInstructorEvaluationDeleteLink(eval.courseId,eval.name,(isHome ? Const.ActionURIs.INSTRUCTOR_HOME_PAGE : Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE)) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_DELETE+ "String_Node_Str"+ "String_Node_Str"+ eval.courseId+ "String_Node_Str"+ eval.name+ "String_Node_Str"+ disableDeleteSessionStr+ "String_Node_Str");
result.append("String_Node_Str" + (hasRemind ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationRemindLink(eval.courseId,eval.name)+ "String_Node_Str"+ (hasRemind ? "String_Node_Str" + eval.name + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ Const.Tooltips.EVALUATION_REMIND+ "String_Node_Str");
if (hasUnpublish) {
result.append("String_Node_Str" + "String_Node_Str" + getInstructorEvaluationUnpublishLink(eval.courseId,eval.name,isHome) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_UNPUBLISH+ "String_Node_Str"+ "String_Node_Str"+ eval.name+ "String_Node_Str"+ disableUnpublishSessionStr+ "String_Node_Str");
}
 else {
result.append("String_Node_Str" + (hasPublish ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationPublishLink(eval.courseId,eval.name,isHome)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_PUBLISH+ "String_Node_Str"+ (hasPublish ? "String_Node_Str" + eval.name + "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 eval 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
 */
public String getInstructorEvaluationActions(EvaluationAttributes eval,boolean isHome,InstructorAttributes instructor){
  StringBuilder result=new StringBuilder();
  boolean hasView=false;
  boolean hasEdit=false;
  boolean hasRemind=false;
  boolean hasPublish=false;
  boolean hasUnpublish=false;
switch (eval.getStatus()) {
case AWAITING:
    hasView=true;
  hasEdit=true;
break;
case OPEN:
hasView=true;
hasEdit=true;
hasRemind=true;
break;
case CLOSED:
hasView=true;
hasEdit=true;
hasPublish=true;
break;
case PUBLISHED:
hasUnpublish=true;
hasView=true;
break;
default :
Assumption.fail("String_Node_Str" + eval.getStatus());
break;
}
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 disableRemindSessionStr=(instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION) && hasRemind) ? "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;
result.append("String_Node_Str" + (hasView ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationResultsLink(eval.courseId,eval.name)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_RESULTS+ "String_Node_Str"+ "String_Node_Str");
result.append("String_Node_Str" + (hasEdit ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationEditLink(eval.courseId,eval.name)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_EDIT+ "String_Node_Str"+ disableEditSessionStr+ "String_Node_Str");
result.append("String_Node_Str" + "String_Node_Str" + getInstructorEvaluationPreviewLink(eval.courseId,eval.name) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_PREVIEW+ "String_Node_Str"+ "String_Node_Str");
result.append("String_Node_Str" + "String_Node_Str" + getInstructorEvaluationDeleteLink(eval.courseId,eval.name,(isHome ? Const.ActionURIs.INSTRUCTOR_HOME_PAGE : Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE)) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_DELETE+ "String_Node_Str"+ "String_Node_Str"+ eval.courseId+ "String_Node_Str"+ eval.name+ "String_Node_Str"+ disableDeleteSessionStr+ "String_Node_Str");
result.append("String_Node_Str" + (hasRemind ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationRemindLink(eval.courseId,eval.name)+ "String_Node_Str"+ (hasRemind ? "String_Node_Str" + eval.name + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ Const.Tooltips.EVALUATION_REMIND+ "String_Node_Str"+ disableRemindSessionStr+ "String_Node_Str");
if (hasUnpublish) {
result.append("String_Node_Str" + "String_Node_Str" + getInstructorEvaluationUnpublishLink(eval.courseId,eval.name,isHome) + "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_UNPUBLISH+ "String_Node_Str"+ "String_Node_Str"+ eval.name+ "String_Node_Str"+ disableUnpublishSessionStr+ "String_Node_Str");
}
 else {
result.append("String_Node_Str" + (hasPublish ? "String_Node_Str" : DISABLED) + "String_Node_Str"+ getInstructorEvaluationPublishLink(eval.courseId,eval.name,isHome)+ "String_Node_Str"+ "String_Node_Str"+ Const.Tooltips.EVALUATION_PUBLISH+ "String_Node_Str"+ (hasPublish ? "String_Node_Str" + eval.name + "String_Node_Str" : "String_Node_Str")+ disablePublishSessionStr+ "String_Node_Str");
}
return result.toString();
}