From e2a4fff81c4cf2b544dbed30643ba330c957525b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Thu, 9 Jun 2011 12:27:31 +0200 Subject: [PATCH] Extract validation checks and fix exception message FEA: ItEr74S04BugFixing --- .../planner/entities/ResourceAllocation.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/ResourceAllocation.java b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/ResourceAllocation.java index 56bf315df..1bf108c8a 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/ResourceAllocation.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/ResourceAllocation.java @@ -213,6 +213,18 @@ public abstract class ResourceAllocation extends return new AllocationsSpecified(resourceAllocations); } + private static void checkStartLessOrEqualToEnd(IntraDayDate startInclusive, + IntraDayDate endExclusive) { + Validate.isTrue(startInclusive.compareTo(endExclusive) <= 0, + "the end must be equal or posterior to the start"); + } + + private static void checkStartLessOrEqualToEnd(LocalDate start, + LocalDate end) { + Validate.isTrue(start.compareTo(end) <= 0, + "the end must be equal or posterior to the start"); + } + /** * Needed for doing fluent interface calls: *