Source:
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(); if (getStartAt().getEntity().compareTo(currentDate) < 0) { 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; }

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; }