Program: 62785
Project: 62785
Buggy source:
private LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> buildResponsesPanelsForGiverQuestionRecipient(Map<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> sortedResponses){
  ViewType viewType=ViewType.GIVER_QUESTION_RECIPIENT;
  FieldValidator validator=new FieldValidator();
  LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesGroupedByTeam=bundle.getQuestionResponseMapByGiverTeam();
  Map<String,FeedbackQuestionAttributes> questions=bundle.questions;
  sectionPanels=new LinkedHashMap<String,InstructorFeedbackResultsSectionPanel>();
  InstructorFeedbackResultsSectionPanel sectionPanel=new InstructorFeedbackResultsSectionPanel();
  Set<String> sectionsInCourse=bundle.rosterSectionTeamNameTable.keySet();
  Set<String> sectionsWithResponses=new HashSet<String>();
  String prevSection=Const.DEFAULT_SECTION;
  Set<String> teamsInSection=new HashSet<String>();
  Set<String> teamsWithResponses=new HashSet<String>();
  String prevTeam="String_Node_Str";
  Set<String> teamMembersInTeam=new HashSet<String>();
  Set<String> teamMembersWithResponses=new HashSet<String>();
  int giverIndex=this.startIndex;
  for (  Map.Entry<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesFromGiver : sortedResponses.entrySet()) {
    giverIndex+=1;
    String giverIdentifier=responsesFromGiver.getKey();
    String currentTeam=getCurrentTeam(bundle,giverIdentifier);
    String currentSection=getCurrentGiverSection(responsesFromGiver);
    if (!prevTeam.equals(currentTeam)) {
      boolean isFirstTeam=prevTeam.equals("String_Node_Str");
      if (!isFirstTeam) {
        createMissingParticipantPanelsWithModerationButtonForPrevTeamAndResetVariables(validator,sectionPanel,prevTeam,teamsWithResponses,teamMembersWithResponses,teamMembersInTeam);
      }
      prevTeam=currentTeam;
      teamsWithResponses.add(currentTeam);
    }
    if (!prevSection.equals(currentSection)) {
      boolean isFirstSection=sectionPanel.getParticipantPanels().isEmpty();
      if (!isFirstSection) {
        buildTeamStatisticsTableForSectionPanel(sectionPanel,prevSection,viewType,questions,responsesGroupedByTeam,teamsWithResponses);
        createMissingTeamAndParticipantPanelsForPrevSectionAndResetVariables(validator,sectionPanel,prevSection,sectionsWithResponses,teamsWithResponses,teamsInSection,currentTeam,true);
        sectionPanel=new InstructorFeedbackResultsSectionPanel();
      }
      teamsInSection=bundle.getTeamsInSectionFromRoster(currentSection);
    }
    FeedbackQuestionAttributes questionForGiver=null;
    List<InstructorResultsQuestionTable> questionTables=new ArrayList<InstructorResultsQuestionTable>();
    int questionIndex=0;
    for (    Map.Entry<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>> responsesFromGiverForQuestion : responsesFromGiver.getValue().entrySet()) {
      if (responsesFromGiverForQuestion.getValue().isEmpty()) {
        continue;
      }
      questionIndex+=1;
      FeedbackQuestionAttributes currentQuestion=responsesFromGiverForQuestion.getKey();
      List<FeedbackResponseAttributes> responsesForQuestion=responsesFromGiverForQuestion.getValue();
      sectionPanel.getIsTeamWithResponses().put(currentTeam,true);
      InstructorResultsQuestionTable questionTable=buildQuestionTable(currentQuestion,responsesForQuestion,viewType,"String_Node_Str" + giverIndex + "String_Node_Str"+ questionIndex,false);
      questionTable.setBoldQuestionNumber(false);
      questionTables.add(questionTable);
      questionForGiver=currentQuestion;
    }
    InstructorResultsModerationButton moderationButton=buildModerationButtonForGiver(null,giverIdentifier,"String_Node_Str","String_Node_Str");
    InstructorFeedbackResultsGroupByQuestionPanel giverPanel=buildInstructorFeedbackResultsGroupByQuestionPanel(validator,giverIdentifier,bundle.getNameForEmail(giverIdentifier),questionForGiver,questionTables,moderationButton,bundle.isParticipantIdentifierStudent(giverIdentifier),true);
    addParticipantPanelToSectionPanel(sectionPanel,currentTeam,giverPanel);
    teamMembersWithResponses.add(giverIdentifier);
    prevSection=currentSection;
  }
  buildTeamStatisticsTableForSectionPanel(sectionPanel,prevSection,viewType,questions,responsesGroupedByTeam,teamsWithResponses);
  createTeamAndParticipantPanelsForLastParticipantSection(bundle,validator,sectionPanel,prevSection,prevTeam,sectionsWithResponses,teamsWithResponses,teamsInSection,teamMembersWithResponses);
  createSectionPanelsForMissingSections(bundle,validator,sectionsInCourse,sectionsWithResponses);
  return responsesGroupedByTeam;
}

Fixed version (ground truth):
private LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> buildResponsesPanelsForGiverQuestionRecipient(Map<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> sortedResponses){
  ViewType viewType=ViewType.GIVER_QUESTION_RECIPIENT;
  FieldValidator validator=new FieldValidator();
  LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesGroupedByTeam=bundle.getQuestionResponseMapByGiverTeam();
  Map<String,FeedbackQuestionAttributes> questions=bundle.questions;
  sectionPanels=new LinkedHashMap<String,InstructorFeedbackResultsSectionPanel>();
  InstructorFeedbackResultsSectionPanel sectionPanel=new InstructorFeedbackResultsSectionPanel();
  Set<String> sectionsInCourse=bundle.rosterSectionTeamNameTable.keySet();
  Set<String> sectionsWithResponses=new HashSet<String>();
  String prevSection=Const.DEFAULT_SECTION;
  Set<String> teamsInSection=new HashSet<String>();
  Set<String> teamsWithResponses=new HashSet<String>();
  String prevTeam="String_Node_Str";
  Set<String> teamMembersInTeam=new HashSet<String>();
  Set<String> teamMembersWithResponses=new HashSet<String>();
  int giverIndex=this.startIndex;
  for (  Map.Entry<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesFromGiver : sortedResponses.entrySet()) {
    giverIndex+=1;
    String giverIdentifier=responsesFromGiver.getKey();
    String currentTeam=getCurrentTeam(bundle,giverIdentifier);
    String currentSection=getCurrentGiverSection(responsesFromGiver);
    if (!prevTeam.equals(currentTeam)) {
      boolean isFirstTeam=prevTeam.equals("String_Node_Str");
      if (!isFirstTeam) {
        createMissingParticipantPanelsWithModerationButtonForPrevTeamAndResetVariables(validator,sectionPanel,prevTeam,teamsWithResponses,teamMembersWithResponses,teamMembersInTeam);
      }
      prevTeam=currentTeam;
      teamsWithResponses.add(currentTeam);
    }
    if (!prevSection.equals(currentSection)) {
      boolean isFirstSection=sectionPanel.getParticipantPanels().isEmpty();
      if (!isFirstSection) {
        buildTeamsStatisticsTableForSectionPanel(sectionPanel,prevSection,viewType,questions,responsesGroupedByTeam,teamsWithResponses);
        createMissingTeamAndParticipantPanelsForPrevSectionAndResetVariables(validator,sectionPanel,prevSection,sectionsWithResponses,teamsWithResponses,teamsInSection,currentTeam,true);
        sectionPanel=new InstructorFeedbackResultsSectionPanel();
      }
      teamsInSection=bundle.getTeamsInSectionFromRoster(currentSection);
    }
    FeedbackQuestionAttributes questionForGiver=null;
    List<InstructorResultsQuestionTable> questionTables=new ArrayList<InstructorResultsQuestionTable>();
    int questionIndex=0;
    for (    Map.Entry<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>> responsesFromGiverForQuestion : responsesFromGiver.getValue().entrySet()) {
      if (responsesFromGiverForQuestion.getValue().isEmpty()) {
        continue;
      }
      questionIndex+=1;
      FeedbackQuestionAttributes currentQuestion=responsesFromGiverForQuestion.getKey();
      List<FeedbackResponseAttributes> responsesForQuestion=responsesFromGiverForQuestion.getValue();
      sectionPanel.getIsTeamWithResponses().put(currentTeam,true);
      InstructorResultsQuestionTable questionTable=buildQuestionTable(currentQuestion,responsesForQuestion,viewType,"String_Node_Str" + giverIndex + "String_Node_Str"+ questionIndex,false);
      questionTable.setBoldQuestionNumber(false);
      questionTables.add(questionTable);
      questionForGiver=currentQuestion;
    }
    InstructorResultsModerationButton moderationButton=buildModerationButtonForGiver(null,giverIdentifier,"String_Node_Str","String_Node_Str");
    InstructorFeedbackResultsGroupByQuestionPanel giverPanel=buildInstructorFeedbackResultsGroupByQuestionPanel(validator,giverIdentifier,bundle.getNameForEmail(giverIdentifier),questionForGiver,questionTables,moderationButton,bundle.isParticipantIdentifierStudent(giverIdentifier),true);
    addParticipantPanelToSectionPanel(sectionPanel,currentTeam,giverPanel);
    teamMembersWithResponses.add(giverIdentifier);
    prevSection=currentSection;
  }
  buildTeamsStatisticsTableForSectionPanel(sectionPanel,prevSection,viewType,questions,responsesGroupedByTeam,teamsWithResponses);
  createTeamAndParticipantPanelsForLastParticipantSection(validator,sectionPanel,prevSection,prevTeam,sectionsWithResponses,teamsWithResponses,teamsInSection,teamMembersWithResponses);
  createSectionPanelsForMissingSections(bundle,validator,sectionsInCourse,sectionsWithResponses);
  return responsesGroupedByTeam;
}