Program: 62784
Project: 62784
Buggy source:
private LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> buildResponsesPanelsForRecipientQuestionGiver(Map<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> sortedResponses){
  ViewType viewType=ViewType.RECIPIENT_QUESTION_GIVER;
  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 recipientIndex=this.startIndex;
  for (  Map.Entry<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesToRecipient : sortedResponses.entrySet()) {
    recipientIndex+=1;
    String recipientIdentifier=responsesToRecipient.getKey();
    String currentTeam=getCurrentTeam(bundle,recipientIdentifier);
    String currentSection=getCurrentRecipientSection(responsesToRecipient);
    if (!prevTeam.equals(currentTeam)) {
      boolean isFirstTeam=prevTeam.equals("String_Node_Str");
      if (!isFirstTeam) {
        createMissingParticipantPanelsWithoutModerationButtonForPrevTeamAndResetVariables(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,false);
        sectionPanel=new InstructorFeedbackResultsSectionPanel();
      }
      teamsInSection=bundle.getTeamsInSectionFromRoster(currentSection);
    }
    FeedbackQuestionAttributes questionForRecipient=null;
    List<InstructorResultsQuestionTable> questionTables=new ArrayList<InstructorResultsQuestionTable>();
    int questionIndex=0;
    for (    Map.Entry<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>> responsesToRecipientForQuestion : responsesToRecipient.getValue().entrySet()) {
      if (responsesToRecipientForQuestion.getValue().isEmpty()) {
        continue;
      }
      questionIndex+=1;
      FeedbackQuestionAttributes currentQuestion=responsesToRecipientForQuestion.getKey();
      List<FeedbackResponseAttributes> responsesForQuestion=responsesToRecipientForQuestion.getValue();
      sectionPanel.getIsTeamWithResponses().put(currentTeam,true);
      InstructorResultsQuestionTable questionTable=buildQuestionTable(currentQuestion,responsesForQuestion,viewType,"String_Node_Str" + recipientIndex + "String_Node_Str"+ questionIndex,false);
      questionTable.setBoldQuestionNumber(false);
      questionTables.add(questionTable);
      questionForRecipient=currentQuestion;
    }
    InstructorResultsModerationButton moderationButton=buildModerationButtonForGiver(null,recipientIdentifier,"String_Node_Str","String_Node_Str");
    InstructorFeedbackResultsGroupByQuestionPanel recipientPanel=buildInstructorFeedbackResultsGroupByQuestionPanel(validator,recipientIdentifier,bundle.getNameForEmail(recipientIdentifier),questionForRecipient,questionTables,moderationButton,false,false);
    addParticipantPanelToSectionPanel(sectionPanel,currentTeam,recipientPanel);
    teamMembersWithResponses.add(recipientIdentifier);
    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>>> buildResponsesPanelsForRecipientQuestionGiver(Map<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> sortedResponses){
  ViewType viewType=ViewType.RECIPIENT_QUESTION_GIVER;
  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 recipientIndex=this.startIndex;
  for (  Map.Entry<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesToRecipient : sortedResponses.entrySet()) {
    recipientIndex+=1;
    String recipientIdentifier=responsesToRecipient.getKey();
    String currentTeam=getCurrentTeam(bundle,recipientIdentifier);
    String currentSection=getCurrentRecipientSection(responsesToRecipient);
    if (!prevTeam.equals(currentTeam)) {
      boolean isFirstTeam=prevTeam.equals("String_Node_Str");
      if (!isFirstTeam) {
        createMissingParticipantPanelsWithoutModerationButtonForPrevTeamAndResetVariables(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,false);
        sectionPanel=new InstructorFeedbackResultsSectionPanel();
      }
      teamsInSection=bundle.getTeamsInSectionFromRoster(currentSection);
    }
    FeedbackQuestionAttributes questionForRecipient=null;
    List<InstructorResultsQuestionTable> questionTables=new ArrayList<InstructorResultsQuestionTable>();
    int questionIndex=0;
    for (    Map.Entry<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>> responsesToRecipientForQuestion : responsesToRecipient.getValue().entrySet()) {
      if (responsesToRecipientForQuestion.getValue().isEmpty()) {
        continue;
      }
      questionIndex+=1;
      FeedbackQuestionAttributes currentQuestion=responsesToRecipientForQuestion.getKey();
      List<FeedbackResponseAttributes> responsesForQuestion=responsesToRecipientForQuestion.getValue();
      sectionPanel.getIsTeamWithResponses().put(currentTeam,true);
      InstructorResultsQuestionTable questionTable=buildQuestionTable(currentQuestion,responsesForQuestion,viewType,"String_Node_Str" + recipientIndex + "String_Node_Str"+ questionIndex,false);
      questionTable.setBoldQuestionNumber(false);
      questionTables.add(questionTable);
      questionForRecipient=currentQuestion;
    }
    InstructorResultsModerationButton moderationButton=buildModerationButtonForGiver(null,recipientIdentifier,"String_Node_Str","String_Node_Str");
    InstructorFeedbackResultsGroupByQuestionPanel recipientPanel=buildInstructorFeedbackResultsGroupByQuestionPanel(validator,recipientIdentifier,bundle.getNameForEmail(recipientIdentifier),questionForRecipient,questionTables,moderationButton,false,false);
    addParticipantPanelToSectionPanel(sectionPanel,currentTeam,recipientPanel);
    teamMembersWithResponses.add(recipientIdentifier);
    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;
}