Source:
public FeedbackSessionDetailsBundle getFeedbackSessionDetails( FeedbackSessionAttributes fsa) throws EntityDoesNotExistException { FeedbackSessionDetailsBundle details = new FeedbackSessionDetailsBundle(fsa); details.stats.expectedTotal = 0; details.stats.submittedTotal = 0; switch (fsa.getFeedbackSessionType()) { case STANDARD: List<StudentAttributes> students = studentsLogic.getStudentsForCourse(fsa.getCourseId()); List<InstructorAttributes> instructors = instructorsLogic.getInstructorsForCourse(fsa.getCourseId()); List<FeedbackQuestionAttributes> questions = fqLogic.getFeedbackQuestionsForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()); List<FeedbackQuestionAttributes> studentQns = fqLogic.getFeedbackQuestionsForStudents(questions); if (!studentQns.isEmpty()) { details.stats.expectedTotal += students.size(); } for (InstructorAttributes instructor : instructors) { List<FeedbackQuestionAttributes> instructorQns = fqLogic.getFeedbackQuestionsForInstructor(questions, fsa.isCreator(instructor.email)); if (!instructorQns.isEmpty()) { details.stats.expectedTotal += 1; } } details.stats.submittedTotal += fsa.getRespondingStudentList().size() + fsa.getRespondingInstructorList().size(); break; case PRIVATE: List<FeedbackQuestionAttributes> instuctorQuestions = fqLogic.getFeedbackQuestionsForInstructor(fsa.getFeedbackSessionName(), fsa.getCourseId(), fsa.getCreatorEmail()); List<FeedbackQuestionAttributes> validQuestions = fqLogic.getQuestionsWithRecipients(instuctorQuestions, fsa.getCreatorEmail()); if (validQuestions.isEmpty()) { break; } details.stats.expectedTotal = 1; if (this.isFeedbackSessionFullyCompletedByInstructor(fsa.getFeedbackSessionName(), fsa.getCourseId(), fsa.getCreatorEmail())) { details.stats.submittedTotal = 1; } break; default: break; } return details; }

Target:
public FeedbackSessionDetailsBundle getFeedbackSessionDetails( FeedbackSessionAttributes fsa) throws EntityDoesNotExistException { FeedbackSessionDetailsBundle details = new FeedbackSessionDetailsBundle(fsa); details.stats.expectedTotal = 0; details.stats.submittedTotal = 0; switch (fsa.getFeedbackSessionType()) { case STANDARD: List<StudentAttributes> students = studentsLogic.getStudentsForCourse(fsa.getCourseId()); List<InstructorAttributes> instructors = instructorsLogic.getInstructorsForCourse(fsa.getCourseId()); List<FeedbackQuestionAttributes> questions = fqLogic.getFeedbackQuestionsForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()); List<FeedbackQuestionAttributes> studentQns = fqLogic.getFeedbackQuestionsForStudents(questions); if (!studentQns.isEmpty()) { details.stats.expectedTotal += students.size(); } for (InstructorAttributes instructor : instructors) { List<FeedbackQuestionAttributes> instructorQns = fqLogic.getFeedbackQuestionsForInstructor(questions, fsa.isCreator(instructor.email)); if (!instructorQns.isEmpty()) { details.stats.expectedTotal += 1; } } details.stats.submittedTotal += fsa.getRespondingStudentList().size() + fsa.getRespondingInstructorList().size(); break; case PRIVATE: List<FeedbackQuestionAttributes> instuctorQuestions = fqLogic.getFeedbackQuestionsForInstructor(fsa.getFeedbackSessionName(), fsa.getCourseId(), fsa.getCreatorEmail()); List<FeedbackQuestionAttributes> validQuestions = fqLogic.getQuestionsWithRecipients(instuctorQuestions, fsa.getCreatorEmail()); if (validQuestions.isEmpty()) { break; } details.stats.expectedTotal = 1; if (isFeedbackSessionFullyCompletedByInstructor(fsa.getFeedbackSessionName(), fsa.getCourseId(), fsa.getCreatorEmail())) { details.stats.submittedTotal = 1; } break; default: break; } return details; }