|| executionPeriodFromExecutionCourse.getIdInternal().equals(previouseExecutionPeriod.getIdInternal())) {
|| (previouseExecutionPeriod != null && executionPeriodFromExecutionCourse.getIdInternal().equals(previouseExecutionPeriod.getIdInternal()))) {
    public Object run(Integer degreeOID) throws ExcepcaoPersistencia    {        List executionCourseViews = new ArrayList();        ISuportePersistente persistentSupport = PersistenceSupportFactory.getDefaultPersistenceSupport();        IPersistentExecutionPeriod persistentExecutionPeriod = persistentSupport        		.getIPersistentExecutionPeriod();        ICursoPersistente persistentDegree = persistentSupport.getICursoPersistente();        ExecutionPeriod currentExecutionPeriod = persistentExecutionPeriod.readActualExecutionPeriod();        ExecutionPeriod previouseExecutionPeriod = currentExecutionPeriod.getPreviousExecutionPeriod();        Degree degree = (Degree) persistentDegree.readByOID(Degree.class, degreeOID);        List<DegreeCurricularPlan> degreeCurricularPlans = degree.getDegreeCurricularPlans();        Set processedExecutionCourses = new HashSet();        for (DegreeCurricularPlan degreeCurricularPlan : degreeCurricularPlans) {            if (degreeCurricularPlan.getCurricularStage().equals(CurricularStage.OLD)) {                List curricularCourses = degreeCurricularPlan.getCurricularCourses();                for (Iterator iteratorCC = curricularCourses.iterator(); iteratorCC.hasNext();) {                    CurricularCourse curricularCourse = (CurricularCourse) iteratorCC.next();                    List executionCourses = curricularCourse.getAssociatedExecutionCourses();                                       for (Iterator iteratorEC = executionCourses.iterator(); iteratorEC.hasNext();) {                        ExecutionCourse executionCourse = (ExecutionCourse) iteratorEC.next();                        ExecutionPeriod executionPeriodFromExecutionCourse = executionCourse.getExecutionPeriod();                                               if (executionPeriodFromExecutionCourse.getIdInternal().equals(currentExecutionPeriod.getIdInternal())                                || executionPeriodFromExecutionCourse.getIdInternal().equals(previouseExecutionPeriod.getIdInternal())) {                            for (Iterator iteratorCCS = curricularCourse.getScopes().iterator(); iteratorCCS.hasNext();) {                                CurricularCourseScope curricularCourseScope = (CurricularCourseScope) iteratorCCS.next();                                String key = generateExecutionCourseKey(executionCourse, curricularCourseScope);                                if (!processedExecutionCourses.contains(key)) {                                    ExecutionCourseView executionCourseView = new ExecutionCourseView();                                    executionCourseView.setExecutionCourseOID(executionCourse.getIdInternal());                                    executionCourseView.setExecutionCourseName(executionCourse.getNome());                                    executionCourseView.setSemester(executionCourse.getExecutionPeriod().getSemester());                                                            executionCourseView.setCurricularYear(curricularCourseScope.getCurricularSemester().getCurricularYear().getYear());                                    executionCourseView.setExecutionPeriodOID(executionCourse.getExecutionPeriod().getIdInternal());                                    executionCourseView.setAnotation(curricularCourseScope.getAnotation());                                    executionCourseView.setDegreeCurricularPlanAnotation(degreeCurricularPlan.getAnotation());                                    executionCourseViews.add(executionCourseView);                                    processedExecutionCourses.add(key);                                }                            }                        }                    }                }                            }        }        return executionCourseViews;    }