protected Set<Teacher> getTeachers(List<ExecutionSemester> executionSemesters) { Set<Teacher> teachers = new HashSet<Teacher>(); ExecutionYear previousExecutionYear = executionSemester.getExecutionYear().getPreviousExecutionYear(); for (final DegreeCurricularPlan degreeCurricularPlan : degree.getDegreeCurricularPlansSet()) { for (final CurricularCourse course : degreeCurricularPlan.getCurricularCourses()) { for (final ExecutionCourse executionCourse : course.getAssociatedExecutionCourses()) { if (executionSemesters.contains(executionCourse.getExecutionPeriod())) { for (Professorship professorhip : executionCourse.getProfessorshipsSet()) { if (professorhip .getPerson() .getTeacher() .isActiveOrHasAuthorizationForSemester(executionCourse.getExecutionPeriod())) { teachers.add(professorhip.getPerson().getTeacher()); } } } if (previousExecutionYear.equals( executionCourse.getExecutionPeriod().getExecutionYear())) { if (executionCourse.isDissertation()) { for (Attends attends : executionCourse.getAttends()) { if (attends.hasEnrolment() && attends.getEnrolment().getThesis() != null) { for (ThesisEvaluationParticipant thesisEvaluationParticipant : attends.getEnrolment().getThesis().getOrientation()) { if (thesisEvaluationParticipant.getPerson().getTeacher() != null && thesisEvaluationParticipant .getPerson() .getTeacher() .isActiveOrHasAuthorizationForSemester( executionCourse.getExecutionPeriod())) { teachers.add(thesisEvaluationParticipant.getPerson().getTeacher()); } } } } } } } } } PhdProgram phdProgram = degree.getPhdProgram(); if (phdProgram != null) { for (PhdIndividualProgramProcess phdIndividualProgramProcess : phdProgram.getIndividualProgramProcesses()) { for (ExecutionSemester executionSemester : executionSemesters) { if (phdIndividualProgramProcess.isActive( executionSemester.getAcademicInterval().toInterval())) { for (PhdParticipant phdParticipant : phdIndividualProgramProcess.getParticipants()) { if (phdParticipant instanceof InternalPhdParticipant) { InternalPhdParticipant internalPhdParticipant = (InternalPhdParticipant) phdParticipant; if (internalPhdParticipant.isGuidingOrAssistantGuiding() && internalPhdParticipant.getPerson().getTeacher() != null && internalPhdParticipant .getPerson() .getTeacher() .isActiveOrHasAuthorizationForSemester(executionSemester)) { teachers.add(internalPhdParticipant.getPerson().getTeacher()); } } } } } } } return teachers; }