}
return result;
}
private FenixServiceException verify(DegreeCurricularPlan degreeCurricularPlan) {
final EnrolmentPeriodInClasses enrolmentPeriodInClasses = degreeCurricularPlan.getCurrentClassesEnrollmentPeriod();
if (enrolmentPeriodInClasses == null || enrolmentPeriodInClasses.getStartDateDateTime() == null
|| enrolmentPeriodInClasses.getEndDateDateTime() == null) {
return new CurrentClassesEnrolmentPeriodUndefinedForDegreeCurricularPlan();
}
Date now = new Date();
Date startDate = enrolmentPeriodInClasses.getStartDate();
Date endDate = enrolmentPeriodInClasses.getEndDate();
if (DateFormatUtil.compareDates(comparableDateFormatString, startDate, now) > 0
|| DateFormatUtil.compareDates(comparableDateFormatString, endDate, now) < 0) {
String startDateString = outputDateFormat.format(startDate);
String endDateString = outputDateFormat.format(endDate);
StringBuilder buffer = new StringBuilder();
buffer.append(startDateString);
buffer.append(" - ");
buffer.append(endDateString);
buffer.append(" (").append(enrolmentPeriodInClasses.getExecutionPeriod().getExecutionYear().getName()).append(")");
return new OutsideOfCurrentClassesEnrolmentPeriodForDegreeCurricularPlan(buffer.toString());
}
return null;
}