if (cursoExecucao == null || cursoExecucao.getDegreeCurricularPlan() == null || cursoExecucao.getDegreeCurricularPlan().getCurricularCourses() == null || cursoExecucao.getDegreeCurricularPlan().getCurricularCourses() .size() == 0) { throw new NonExistingServiceException(); }
IExecutionDegree executionDegree = sp.getIPersistentExecutionDegree() .readByDegreeCurricularPlanNameAndExecutionYear(degreeName, executionYear.getIdInternal());
	public List run(String executionYearString, String degreeName)			throws FenixServiceException {		List infoCurricularCourses = null;		try {			ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();			IExecutionYear executionYear = sp.getIPersistentExecutionYear()					.readExecutionYearByName(executionYearString);			// Read degree			IExecutionDegree cursoExecucao = sp.getIPersistentExecutionDegree()					.readByDegreeCurricularPlanNameAndExecutionYear(degreeName,							executionYear.getIdInternal());			if (cursoExecucao == null					|| cursoExecucao.getDegreeCurricularPlan() == null					|| cursoExecucao.getDegreeCurricularPlan().getCurricularCourses() == null					|| cursoExecucao.getDegreeCurricularPlan().getCurricularCourses()							.size() == 0) {				throw new NonExistingServiceException();			}			infoCurricularCourses = new ArrayList();			ListIterator iterator = cursoExecucao.getDegreeCurricularPlan()					.getCurricularCourses().listIterator();			while (iterator.hasNext()) {				ICurricularCourse curricularCourse = (ICurricularCourse) iterator						.next();				InfoCurricularCourse infoCurricularCourse = Cloner						.copyCurricularCourse2InfoCurricularCourse(curricularCourse);				infoCurricularCourse.setInfoScopes((List) CollectionUtils						.collect(curricularCourse.getScopes(),								new Transformer() {									public Object transform(Object arg0) {										ICurricularCourseScope curricularCourseScope = (ICurricularCourseScope) arg0;										return Cloner												.copyICurricularCourseScope2InfoCurricularCourseScope(curricularCourseScope);									}								}));				infoCurricularCourses.add(infoCurricularCourse);			}		} catch (ExcepcaoPersistencia ex) {			FenixServiceException newEx = new FenixServiceException(					"Persistence layer error");			newEx.fillInStackTrace();			throw newEx;		}		return infoCurricularCourses;	}