Source:
public ActionForward proceedToShiftEnrolment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { checkParameter(request); final String classIdSelected = readClassSelected(request); final Registration registration = getAndSetRegistration(request); if (registration == null) { addActionMessage(request, "errors.impossible.operation"); return mapping.getInputForward(); } final ExecutionCourse executionCourse = getExecutionCourse(request); final List<SchoolClass> schoolClassesToEnrol = readStudentSchoolClassesToEnrolUsingExecutionCourse(request, registration, executionCourse); request.setAttribute("schoolClassesToEnrol", schoolClassesToEnrol); if (schoolClassesToEnrol.isEmpty()) { return mapping.findForward("prepareShiftEnrollment"); } final SchoolClass schoolClass = setSelectedSchoolClass(request, classIdSelected, schoolClassesToEnrol); final ExecutionSemester executionSemester = getDomainObject(request, "executionSemesterID"); final List<InfoShowOccupation> infoClasslessons = ReadClassTimeTableByStudent.runReadClassTimeTableByStudent(registration, schoolClass, executionCourse, executionSemester); request.setAttribute("infoClasslessons", infoClasslessons); request.setAttribute("infoClasslessonsEndTime", Integer.valueOf(getEndTime(infoClasslessons))); final List<InfoShowOccupation> infoLessons = new ArrayList<InfoShowOccupation>(); for (Registration reg : registration.getStudent().getAllRegistrations()) { infoLessons.addAll(ReadStudentTimeTable.run(reg, executionSemester)); } request.setAttribute("person", registration.getPerson()); request.setAttribute("infoLessons", infoLessons); request.setAttribute("infoLessonsEndTime", Integer.valueOf(getEndTime(infoLessons))); request.setAttribute("executionSemesterID", executionSemester.getExternalId()); return mapping.findForward("showShiftsToEnroll"); }

Target:
public ActionForward proceedToShiftEnrolment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { checkParameter(request); final String classIdSelected = readClassSelected(request); final Registration registration = getAndSetRegistration(request); if (registration == null) { addActionMessage(request, "errors.impossible.operation"); return mapping.getInputForward(); } final ExecutionCourse executionCourse = getExecutionCourse(request); final List<SchoolClass> schoolClassesToEnrol = readStudentSchoolClassesToEnrolUsingExecutionCourse(request, registration, executionCourse); request.setAttribute("schoolClassesToEnrol", schoolClassesToEnrol); if (schoolClassesToEnrol.isEmpty()) { return mapping.findForward("prepareShiftEnrollment"); } final SchoolClass schoolClass = setSelectedSchoolClass(request, classIdSelected, schoolClassesToEnrol); final ExecutionSemester executionSemester = getDomainObject(request, "executionSemesterID"); final List<InfoShowOccupation> infoClasslessons = ReadClassTimeTableByStudent.runReadClassTimeTableByStudent(registration, schoolClass, executionCourse, executionSemester); request.setAttribute("infoClasslessons", infoClasslessons); request.setAttribute("infoClasslessonsEndTime", Integer.valueOf(getEndTime(infoClasslessons))); final List<InfoShowOccupation> infoLessons = new ArrayList<InfoShowOccupation>(); for (Registration reg : registration.getStudent().getRegistrationStream().collect(Collectors.toList())) { infoLessons.addAll(ReadStudentTimeTable.run(reg, executionSemester)); } request.setAttribute("person", registration.getPerson()); request.setAttribute("infoLessons", infoLessons); request.setAttribute("infoLessonsEndTime", Integer.valueOf(getEndTime(infoLessons))); request.setAttribute("executionSemesterID", executionSemester.getExternalId()); return mapping.findForward("showShiftsToEnroll"); }