Program: 62796
Project: 62796
Buggy source:
private LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> buildResponsesPanelsForRecipientQuestionGiver(FeedbackSessionResultsBundle bundle,ViewType viewType,FieldValidator validator,Map<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> sortedResponses){
  LinkedHashMap<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> responsesGroupedByTeam=bundle.getQuestionResponseMapByGiverTeam();
  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=getCurrentSection(responsesToRecipient);
    if (!prevTeam.equals(currentTeam)) {
      boolean isFirstTeam=prevTeam.equals("String_Node_Str");
      if (!isFirstTeam) {
        createMissingParticipantPanelsForPrevTeamAndResetVariables(bundle,validator,sectionPanel,prevTeam,teamsWithResponses,teamMembersWithResponses,teamMembersInTeam,currentTeam);
        teamsWithResponses.add(currentTeam);
      }
      prevTeam=currentTeam;
    }
    if (!prevSection.equals(currentSection)) {
      boolean isFirstSection=sectionPanel.getParticipantPanels().isEmpty();
      if (!isFirstSection) {
        createTeamAndParticipantPanelsForPrevSectionAndResetVariables(bundle,validator,sectionPanel,prevSection,sectionsWithResponses,teamsWithResponses,teamsInSection,currentTeam);
        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,bundle.isParticipantIdentifierStudent(recipientIdentifier),false);
    recipientPanel.setModerationButtonDisplayed(bundle.isParticipantIdentifierStudent(recipientIdentifier));
    addParticipantPanelToSectionPanel(sectionPanel,currentTeam,recipientPanel);
    teamMembersWithResponses.add(recipientIdentifier);
    prevSection=currentSection;
  }
  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(FeedbackSessionResultsBundle bundle,ViewType viewType,Map<String,Map<FeedbackQuestionAttributes,List<FeedbackResponseAttributes>>> sortedResponses){
  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=getCurrentSection(responsesToRecipient);
    if (!prevTeam.equals(currentTeam)) {
      boolean isFirstTeam=prevTeam.equals("String_Node_Str");
      if (!isFirstTeam) {
        createMissingParticipantPanelsForPrevTeamAndResetVariables(bundle,validator,sectionPanel,prevTeam,teamsWithResponses,teamMembersWithResponses,teamMembersInTeam,currentTeam);
      }
      prevTeam=currentTeam;
      teamsWithResponses.add(currentTeam);
    }
    if (!prevSection.equals(currentSection)) {
      boolean isFirstSection=sectionPanel.getParticipantPanels().isEmpty();
      if (!isFirstSection) {
        buildTeamStatisticsTableForSectionPanel(sectionPanel,prevSection,viewType,questions,responsesGroupedByTeam,teamsWithResponses);
        createMissingTeamAndParticipantPanelsForPrevSectionAndResetVariables(bundle,validator,sectionPanel,prevSection,sectionsWithResponses,teamsWithResponses,teamsInSection,currentTeam);
        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,bundle.isParticipantIdentifierStudent(recipientIdentifier),false);
    recipientPanel.setModerationButtonDisplayed(bundle.isParticipantIdentifierStudent(recipientIdentifier));
    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;
}