ItEr59S08CUAsignacionRecursosLimitantesItEr58S10: Fix bug infinite loop on inserting a queue element directly at a specific time

This commit is contained in:
Diego Pino Garcia 2010-06-02 19:38:32 +02:00 committed by Javier Moran Rua
parent 6e7fa6ee0d
commit 129f3db74b

View file

@ -798,6 +798,7 @@ public class LimitingResourceQueueModel implements ILimitingResourceQueueModel {
if (gap != null) {
final LocalDate startDate = gap.getStartTime().getDate();
if (startDate.equals(allocationTime.getDate())) {
assignLimitingResourceQueueElementToQueueAt(element, queue, allocationTime);
break;
@ -832,7 +833,8 @@ public class LimitingResourceQueueModel implements ILimitingResourceQueueModel {
// Rest of elements
for (int i = 0; i < elements.size(); i++) {
final LimitingResourceQueueElement each = elements.get(i);
if (isInTheMiddle(each, allocationTime)) {
if (isInTheMiddle(each, allocationTime) ||
isAfter(each, allocationTime)) {
return each;
}
}