Program: 62812
Project: 62812
Buggy source:
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String needAjax=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_NEED_AJAX);
  boolean isHtmlTableNeeded=getRequestParamAsBoolean(Const.ParamsNames.CSV_TO_HTML_TABLE_NEEDED);
  int queryRange;
  if (needAjax != null) {
    queryRange=QUERY_RANGE_FOR_AJAX_TESTING;
  }
 else {
    queryRange=DEFAULT_QUERY_RANGE;
  }
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  String feedbackSessionName=getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
  Assumption.assertNotNull(courseId);
  Assumption.assertNotNull(feedbackSessionName);
  statusToAdmin="String_Node_Str" + "String_Node_Str" + feedbackSessionName + "String_Node_Str"+ "String_Node_Str"+ courseId;
  InstructorAttributes instructor=logic.getInstructorForGoogleId(courseId,account.googleId);
  FeedbackSessionAttributes session=logic.getFeedbackSession(feedbackSessionName,courseId);
  boolean isCreatorOnly=true;
  new GateKeeper().verifyAccessible(instructor,session,!isCreatorOnly);
  InstructorFeedbackResultsPageData data=new InstructorFeedbackResultsPageData(account);
  data.selectedSection=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYSECTION);
  data.instructor=instructor;
  data.showStats=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_SHOWSTATS);
  data.groupByTeam=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYTEAM);
  data.sortType=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE);
  data.courseId=courseId;
  data.feedbackSessionName=feedbackSessionName;
  if (data.selectedSection == null) {
    data.selectedSection=ALL_SECTION_OPTION;
  }
  if (isHtmlTableNeeded) {
    try {
      if (!data.selectedSection.contentEquals(ALL_SECTION_OPTION)) {
        data.sessionResultsHtmlTableAsString=StringHelper.csvToHtmlTable(logic.getFeedbackSessionResultSummaryInSectionAsCsv(courseId,feedbackSessionName,instructor.email,data.selectedSection));
      }
 else {
        data.sessionResultsHtmlTableAsString=StringHelper.csvToHtmlTable(logic.getFeedbackSessionResultSummaryAsCsv(courseId,feedbackSessionName,instructor.email));
      }
    }
 catch (    ExceedingRangeException e) {
      data.sessionResultsHtmlTableAsString="String_Node_Str";
      data.ajaxStatus="String_Node_Str";
    }
    return createAjaxResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_TOP,data);
  }
 else {
    data.sessionResultsHtmlTableAsString="String_Node_Str";
    data.ajaxStatus="String_Node_Str";
  }
  String startIndex=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_MAIN_INDEX);
  if (startIndex != null) {
    data.startIndex=Integer.parseInt(startIndex);
  }
  if (data.sortType == null) {
    data.showStats=new String("String_Node_Str");
    data.groupByTeam=new String("String_Node_Str");
    data.sortType=new String("String_Node_Str");
  }
  data.sections=logic.getSectionNamesForCourse(courseId);
  String questionNumStr=getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER);
  if (data.selectedSection.equals(ALL_SECTION_OPTION) && questionNumStr == null) {
    data.bundle=logic.getFeedbackSessionResultsForInstructorWithinRangeFromView(feedbackSessionName,courseId,data.instructor.email,queryRange,data.sortType);
  }
 else   if (data.sortType.equals("String_Node_Str")) {
    if (questionNumStr == null) {
      data.bundle=logic.getFeedbackSessionResultsForInstructorInSection(feedbackSessionName,courseId,data.instructor.email,data.selectedSection);
    }
 else {
      int questionNum=Integer.parseInt(questionNumStr);
      data.bundle=logic.getFeedbackSessionResultsForInstructorFromQuestion(feedbackSessionName,courseId,data.instructor.email,questionNum);
    }
  }
 else   if (data.sortType.equals("String_Node_Str") || data.sortType.equals("String_Node_Str")) {
    data.bundle=logic.getFeedbackSessionResultsForInstructorFromSectionWithinRange(feedbackSessionName,courseId,data.instructor.email,data.selectedSection,DEFAULT_SECTION_QUERY_RANGE);
  }
 else   if (data.sortType.equals("String_Node_Str") || data.sortType.equals("String_Node_Str")) {
    data.bundle=logic.getFeedbackSessionResultsForInstructorToSectionWithinRange(feedbackSessionName,courseId,data.instructor.email,data.selectedSection,DEFAULT_SECTION_QUERY_RANGE);
  }
  if (data.bundle == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + feedbackSessionName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  data.setShouldCollapsed(data.bundle.responses.size() > 500);
  if (data.selectedSection.equals(ALL_SECTION_OPTION) && data.bundle.isComplete == false) {
    statusToUser.add(Const.StatusMessages.FEEDBACK_RESULTS_SECTIONVIEWWARNING);
    isError=true;
  }
switch (data.sortType) {
case "String_Node_Str":
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_QUESTION,data);
case "String_Node_Str":
  return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_GIVER_RECIPIENT_QUESTION,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_QUESTION_GIVER,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_GIVER_QUESTION_RECIPIENT,data);
default :
data.sortType="String_Node_Str";
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
}
}

Fixed version (ground truth):
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String needAjax=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_NEED_AJAX);
  boolean isHtmlTableNeeded=getRequestParamAsBoolean(Const.ParamsNames.CSV_TO_HTML_TABLE_NEEDED);
  int queryRange;
  if (needAjax != null) {
    queryRange=QUERY_RANGE_FOR_AJAX_TESTING;
  }
 else {
    queryRange=DEFAULT_QUERY_RANGE;
  }
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  String feedbackSessionName=getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
  Assumption.assertNotNull(courseId);
  Assumption.assertNotNull(feedbackSessionName);
  statusToAdmin="String_Node_Str" + "String_Node_Str" + feedbackSessionName + "String_Node_Str"+ "String_Node_Str"+ courseId;
  InstructorAttributes instructor=logic.getInstructorForGoogleId(courseId,account.googleId);
  FeedbackSessionAttributes session=logic.getFeedbackSession(feedbackSessionName,courseId);
  boolean isCreatorOnly=true;
  new GateKeeper().verifyAccessible(instructor,session,!isCreatorOnly);
  InstructorFeedbackResultsPageData data=new InstructorFeedbackResultsPageData(account);
  data.selectedSection=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYSECTION);
  data.instructor=instructor;
  data.showStats=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_SHOWSTATS);
  data.groupByTeam=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYTEAM);
  data.sortType=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE);
  data.courseId=courseId;
  data.feedbackSessionName=feedbackSessionName;
  if (data.selectedSection == null) {
    data.selectedSection=ALL_SECTION_OPTION;
  }
  if (isHtmlTableNeeded) {
    try {
      if (!data.selectedSection.contentEquals(ALL_SECTION_OPTION)) {
        data.sessionResultsHtmlTableAsString=StringHelper.csvToHtmlTable(logic.getFeedbackSessionResultSummaryInSectionAsCsv(courseId,feedbackSessionName,instructor.email,data.selectedSection));
      }
 else {
        data.sessionResultsHtmlTableAsString=StringHelper.csvToHtmlTable(logic.getFeedbackSessionResultSummaryAsCsv(courseId,feedbackSessionName,instructor.email));
      }
    }
 catch (    ExceedingRangeException e) {
      data.sessionResultsHtmlTableAsString="String_Node_Str";
      data.ajaxStatus="String_Node_Str";
    }
    return createAjaxResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_TOP,data);
  }
 else {
    data.sessionResultsHtmlTableAsString="String_Node_Str";
    data.ajaxStatus="String_Node_Str";
  }
  String startIndex=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_MAIN_INDEX);
  if (startIndex != null) {
    data.startIndex=Integer.parseInt(startIndex);
  }
  if (data.sortType == null) {
    data.showStats=new String("String_Node_Str");
    data.groupByTeam=new String("String_Node_Str");
    data.sortType=new String("String_Node_Str");
  }
  data.sections=logic.getSectionNamesForCourse(courseId);
  String questionNumStr=getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER);
  if (data.selectedSection.equals(ALL_SECTION_OPTION) && questionNumStr == null) {
    data.bundle=logic.getFeedbackSessionResultsForInstructorWithinRangeFromView(feedbackSessionName,courseId,data.instructor.email,queryRange,data.sortType);
  }
 else   if (data.sortType.equals("String_Node_Str")) {
    if (questionNumStr == null) {
      data.bundle=logic.getFeedbackSessionResultsForInstructorInSection(feedbackSessionName,courseId,data.instructor.email,data.selectedSection);
    }
 else {
      int questionNum=Integer.parseInt(questionNumStr);
      data.bundle=logic.getFeedbackSessionResultsForInstructorFromQuestion(feedbackSessionName,courseId,data.instructor.email,questionNum);
    }
  }
 else   if (data.sortType.equals("String_Node_Str") || data.sortType.equals("String_Node_Str")) {
    data.bundle=logic.getFeedbackSessionResultsForInstructorFromSectionWithinRange(feedbackSessionName,courseId,data.instructor.email,data.selectedSection,DEFAULT_SECTION_QUERY_RANGE);
  }
 else   if (data.sortType.equals("String_Node_Str") || data.sortType.equals("String_Node_Str")) {
    data.bundle=logic.getFeedbackSessionResultsForInstructorToSectionWithinRange(feedbackSessionName,courseId,data.instructor.email,data.selectedSection,DEFAULT_SECTION_QUERY_RANGE);
  }
  if (data.bundle == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + feedbackSessionName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  data.setShouldCollapsed(data.bundle.responses.size() > 500);
  if (data.selectedSection.equals(ALL_SECTION_OPTION) && data.bundle.isComplete == false) {
    statusToUser.add(Const.StatusMessages.FEEDBACK_RESULTS_SECTIONVIEWWARNING);
    isError=true;
  }
switch (data.sortType) {
case "String_Node_Str":
    data.init(data.bundle);
  return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_QUESTION,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_GIVER_RECIPIENT_QUESTION,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_QUESTION_GIVER,data);
case "String_Node_Str":
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_GIVER_QUESTION_RECIPIENT,data);
default :
data.sortType="String_Node_Str";
return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
}
}