Source:
<code>public boolean validate() { boolean validWeekDays = true; boolean validMonthDays = true; boolean validStartDate = true; boolean validEndDate = true; getSnapshotName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(128), new AsciiNameValidation() }); if (getRecurrence().getSelectedItem() == GlusterVolumeSnapshotScheduleRecurrence.WeeklySnapshot && getDaysOfTheWeek().getSelectedItem() == null) { setMessage(ConstantsManager.getInstance().getConstants().noWeekDaysSelectedMessage()); validWeekDays = false; } if (getRecurrence().getSelectedItem() == GlusterVolumeSnapshotScheduleRecurrence.MonthlySnapshot) { if (getDaysOfMonth().getSelectedItem() == null) { setMessage(ConstantsManager.getInstance().getConstants().noMonthDaysSelectedMessage()); validMonthDays = false; } else if (getDaysOfMonth().getSelectedItem().contains(",L") || getDaysOfMonth().getSelectedItem().contains("L,")) { setMessage(ConstantsManager.getInstance().getConstants().lastDayMonthCanBeSelectedAlone()); validMonthDays = false; } } Date currentDate = new Date(); <START> if (getStartAt().getEntity().compareTo(currentDate) < 0) { <END> setMessage(ConstantsManager.getInstance().getConstants().startDateBeforeCurrentDate()); validStartDate = false; } if (getEndByOptions().getSelectedItem() == EndDateOptions.HasEndDate) { if (getEndDate().getEntity().compareTo(getStartAt().getEntity()) <= 0) { setMessage(ConstantsManager.getInstance().getConstants().endDateBeforeStartDate()); validEndDate = false; } else if (getEndDate().getEntity().compareTo(currentDate) < 0) { setMessage(ConstantsManager.getInstance().getConstants().endDateBeforeCurrentDate()); validEndDate = false; } } return getSnapshotName().getIsValid() && getDaysOfTheWeek().getIsValid() && getDaysOfMonth().getIsValid() && validWeekDays && validMonthDays && validStartDate && validEndDate; }</code><technical_language>if getStartAt() is in timezone selected, is this comparison correct</technical_language>

Target:
public boolean validate() { boolean validWeekDays = true; boolean validMonthDays = true; boolean validEndDate = true; getSnapshotName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(128), new AsciiNameValidation() }); if (getRecurrence().getSelectedItem() == GlusterVolumeSnapshotScheduleRecurrence.WeeklySnapshot && getDaysOfTheWeek().getSelectedItem() == null) { setMessage(ConstantsManager.getInstance().getConstants().noWeekDaysSelectedMessage()); validWeekDays = false; } if (getRecurrence().getSelectedItem() == GlusterVolumeSnapshotScheduleRecurrence.MonthlySnapshot) { if (getDaysOfMonth().getSelectedItem() == null) { setMessage(ConstantsManager.getInstance().getConstants().noMonthDaysSelectedMessage()); validMonthDays = false; } else if (getDaysOfMonth().getSelectedItem().contains(",L") || getDaysOfMonth().getSelectedItem().contains("L,")) { setMessage(ConstantsManager.getInstance().getConstants().lastDayMonthCanBeSelectedAlone()); validMonthDays = false; } } if (getEndByOptions().getSelectedItem() == EndDateOptions.HasEndDate && getEndDate().getEntity().compareTo(getStartAt().getEntity()) <= 0) { setMessage(ConstantsManager.getInstance().getConstants().endDateBeforeStartDate()); validEndDate = false; } return getSnapshotName().getIsValid() && getDaysOfTheWeek().getIsValid() && getDaysOfMonth().getIsValid() && validWeekDays && validMonthDays && validEndDate; }