[Bug #867] Fix bug
use method equal in the comparisons and fix the formatted. FEA : ItEr71S04BugFixing
This commit is contained in:
parent
7cd133bd0f
commit
18a345afe5
2 changed files with 13 additions and 5 deletions
|
|
@ -29,6 +29,7 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.hibernate.validator.AssertTrue;
|
||||
import org.hibernate.validator.NotEmpty;
|
||||
|
|
@ -713,9 +714,16 @@ public class BaseCalendar extends IntegrationEntity implements ICalendar {
|
|||
|
||||
public boolean isLastCalendarAvailability(
|
||||
CalendarAvailability calendarAvailability) {
|
||||
return getLastCalendarAvailability() != null ? calendarAvailability
|
||||
.getId() == getLastCalendarAvailability().getId()
|
||||
: false;
|
||||
if (getLastCalendarAvailability() == null
|
||||
|| calendarAvailability == null) {
|
||||
return false;
|
||||
}
|
||||
if (getLastCalendarAvailability().getId() == null
|
||||
&& calendarAvailability.getId() == null) {
|
||||
return getLastCalendarAvailability() == calendarAvailability;
|
||||
}
|
||||
return ObjectUtils.equals(getLastCalendarAvailability().getId(),
|
||||
calendarAvailability.getId());
|
||||
}
|
||||
|
||||
public void setStartDate(CalendarAvailability calendarAvailability,
|
||||
|
|
|
|||
|
|
@ -1216,10 +1216,10 @@ public abstract class BaseCalendarEditionController extends
|
|||
|
||||
private LocalDate getAppropiateEndDate(
|
||||
CalendarAvailability calendarAvailability, Date endDate) {
|
||||
if(endDate == null){
|
||||
if (endDate == null) {
|
||||
if (baseCalendarModel
|
||||
.isLastActivationPeriod(calendarAvailability)) {
|
||||
return null;
|
||||
return null;
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
_("Only the last activation period allows to delete end date."));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue