Example #1
0
  @Override
  public void setCandidacyPeriod(DelegateElectionCandidacyPeriod candidacyPeriod) {
    if (candidacyPeriod != null) {
      validatePeriodGivenExecutionYear(getExecutionYear(), candidacyPeriod);
      if (hasLastVotingPeriod()) {
        if (candidacyPeriod.endsBefore(getLastVotingPeriod())) {
          throw new DomainException(
              "error.elections.edit.colidesWithVotingPeriod",
              new String[] {
                getDegree().getSigla(),
                getCurricularYear().getYear().toString(),
                candidacyPeriod.getPeriod(),
                getLastVotingPeriod().getPeriod()
              });
        }
      }
    }

    super.setCandidacyPeriod(candidacyPeriod);
  }