ItEr59S08CUAsignacionRecursosLimitantesItEr58S10: Fix bug.
The condition was obviously wrong. Relaxing Gap construction so it doesn't fail.
This commit is contained in:
parent
e205190bcc
commit
1d8b04d5be
2 changed files with 6 additions and 4 deletions
|
|
@ -99,9 +99,11 @@ public class Gap implements Comparable<Gap> {
|
|||
}
|
||||
|
||||
private Integer calculateHoursInGap(Resource resource, DateAndHour startTime, DateAndHour endTime) {
|
||||
return (endTime == null) ? Integer.MAX_VALUE : calculateHoursInGap(
|
||||
resource, startTime.getDate(), startTime.getHour(), endTime
|
||||
.getDate(), endTime.getHour());
|
||||
// this method will be removed; when hours in gap is really used
|
||||
// startTime is never null
|
||||
return (endTime == null || startTime == null) ? Integer.MAX_VALUE
|
||||
: calculateHoursInGap(resource, startTime.getDate(), startTime
|
||||
.getHour(), endTime.getDate(), endTime.getHour());
|
||||
}
|
||||
|
||||
public int getHoursInGap() {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class LimitingResourceQueue extends BaseEntity {
|
|||
DateAndHour previousEnd = null;
|
||||
for (LimitingResourceQueueElement each : limitingResourceQueueElements) {
|
||||
DateAndHour startTime = each.getStartTime();
|
||||
if (startTime.isAfter(startTime)) {
|
||||
if (previousEnd == null || startTime.isAfter(previousEnd)) {
|
||||
result.add(Gap.create(resource, previousEnd, startTime));
|
||||
}
|
||||
previousEnd = each.getEndTime();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue