int mandatoryLessonHours = 0; Category category = teacher.getCategory(executionPeriod.getBeginDateYearMonthDay(), executionPeriod.getEndDateYearMonthDay()); if (!monitorCategories.contains(category)) {
int mandatoryLessonHours = 0; Category category = teacher.getCategoryForCreditsByPeriod(executionPeriod); if (category != null && !monitorCategories.contains(category)) {
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws NumberFormatException, FenixFilterException,            FenixServiceException {        DynaActionForm dynaActionForm = (DynaActionForm) form;        IUserView userView = SessionUtils.getUserView(request);        Integer executionPeriodID = (Integer) dynaActionForm.get("executionPeriodId");        ExecutionPeriod executionPeriod = null;        if (executionPeriodID == null) {            executionPeriod = ExecutionPeriod.readActualExecutionPeriod();        } else {            executionPeriod = rootDomainObject.readExecutionPeriodByOID(executionPeriodID);                    }        dynaActionForm.set("executionPeriodId", executionPeriod.getIdInternal());        Collection<Category> categories = rootDomainObject.getCategorys();        List<Category> monitorCategories = (List<Category>) CollectionUtils.select(categories,                new Predicate() {                    public boolean evaluate(Object object) {                        Category category = (Category) object;                        return category.getCode().equals("MNL") || category.getCode().equals("MNT");                    }                });        List<TeacherWithCreditsDTO> teachersCredits = new ArrayList<TeacherWithCreditsDTO>();        for (Department department : userView.getPerson().getManageableDepartmentCredits()) {                        List<Teacher> teachers = department.getTeachers(executionPeriod.getBeginDateYearMonthDay(),                    executionPeriod.getEndDateYearMonthDay());                                for (Teacher teacher : teachers) {                double managementCredits = teacher.getManagementFunctionsCredits(executionPeriod);                double serviceExemptionsCredits = teacher.getServiceExemptionCredits(executionPeriod);                int mandatoryLessonHours = 0;                Category category = teacher.getCategory(executionPeriod.getBeginDateYearMonthDay(), executionPeriod.getEndDateYearMonthDay());                if (!monitorCategories.contains(category)) {                    mandatoryLessonHours = teacher.getMandatoryLessonHours(executionPeriod);                }                TeacherService teacherService = teacher                        .getTeacherServiceByExecutionPeriod(executionPeriod);                CreditLineDTO creditLineDTO = new CreditLineDTO(executionPeriod, teacherService,                        managementCredits, serviceExemptionsCredits, mandatoryLessonHours);                TeacherWithCreditsDTO teacherWithCreditsDTO = new TeacherWithCreditsDTO(teacher,                        category, creditLineDTO);                teachersCredits.add(teacherWithCreditsDTO);            }        }        String sortBy = request.getParameter("sortBy");        request.setAttribute("teachersCreditsListSize", teachersCredits.size());        Iterator orderedTeacherCredits = orderList(sortBy, teachersCredits.iterator());        request.setAttribute("departmentsList", userView.getPerson().getManageableDepartmentCredits());        request.setAttribute("teachersCreditsList", orderedTeacherCredits);                readAndSaveAllExecutionPeriods(request);        return mapping.findForward("show-teachers-credits-list");    }