ISuportePersistente sp = null; IPersistentStudent persistentStudent = null; IStudent student = null;  sp = PersistenceSupportFactory.getDefaultPersistenceSupport();  persistentStudent = sp.getIPersistentStudent(); student = persistentStudent.readStudentByNumberAndDegreeType(studentNumber, degreeType);
IStudent student = persistentStudent.readStudentByNumberAndDegreeType(studentNumber, degreeType);
    public InfoRegistrationDeclaration run(Integer studentNumber, DegreeType degreeType)            throws FenixServiceException, ExcepcaoPersistencia {        ISuportePersistente sp = null;        IPersistentStudent persistentStudent = null;        IStudent student = null;        sp = PersistenceSupportFactory.getDefaultPersistenceSupport();        persistentStudent = sp.getIPersistentStudent();        student = persistentStudent.readStudentByNumberAndDegreeType(studentNumber, degreeType);        if (student == null) {            throw new NonExistingStudentServiceException();        }        IStudentCurricularPlan scp = student.getActiveStudentCurricularPlan();        if (scp == null) {            throw new NonExistingActiveSCPServiceException();        }        IExecutionYear executionYear = null;        if (scp.getEnrolments() != null) {            for (Iterator iter = scp.getEnrolments().iterator(); iter.hasNext();) {                IEnrolment enrollment = (IEnrolment) iter.next();                Calendar calendar = Calendar.getInstance();                Date actualDate = calendar.getTime();                Date beginDate = enrollment.getExecutionPeriod().getExecutionYear().getBeginDate();                Date endDate = enrollment.getExecutionPeriod().getExecutionYear().getEndDate();                if (actualDate.before(endDate) && actualDate.after(beginDate)) {                    executionYear = enrollment.getExecutionPeriod().getExecutionYear();                    break;                }            }        }        if (executionYear == null) {            throw new NonExistingEnrollmentServiceException();        }        String degreeName = scp.getDegreeCurricularPlan().getDegree().getNome();        InfoPerson infoPerson = InfoPerson.newInfoFromDomain(student.getPerson());        InfoExecutionYear infoExecutionYear = InfoExecutionYear.newInfoFromDomain(executionYear);        return new InfoRegistrationDeclaration(degreeName, infoExecutionYear, infoPerson);    }