From b98926549a85ef77d14682f007228bfdb37c799a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Fri, 3 Feb 2012 12:00:39 +0100 Subject: [PATCH] Bug #1343: Use getRawValue instead of getValue in date constraint checkers. Since the start date depends on the value of the end date and vice versa, a recursive, infinite loop can happen when both dates are going to be validated. FEA: ItEr76S04BugFixing --- .../web/planner/company/CompanyPlanningController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java index 009e51ccd..52d3fa9e7 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java @@ -247,8 +247,9 @@ public class CompanyPlanningController implements Composer { throws WrongValueException { Date finishDate = (Date) value; if ((finishDate != null) - && (filterStartDate.getValue() != null) - && (finishDate.compareTo(filterStartDate.getValue()) < 0)) { + && (filterStartDate.getRawValue() != null) + && (finishDate.compareTo((Date) + filterStartDate.getRawValue()) < 0)) { filterFinishDate.setValue(null); throw new WrongValueException(comp, _("must be greater than start date")); @@ -264,8 +265,9 @@ public class CompanyPlanningController implements Composer { throws WrongValueException { Date startDate = (Date) value; if ((startDate != null) - && (filterFinishDate.getValue() != null) - && (startDate.compareTo(filterFinishDate.getValue()) > 0)) { + && (filterFinishDate.getRawValue() != null) + && (startDate.compareTo((Date) + filterFinishDate.getRawValue()) > 0)) { filterStartDate.setValue(null); throw new WrongValueException(comp, _("must be lower than finish date"));