Bug #1473: Using OrderVersion from project in updating

Take advantage to remove some unneeded printStackTrace calls.

FEA: ItEr76S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2012-07-03 09:20:51 +02:00
parent 8ff934e784
commit 2d5891c64c

View file

@ -577,6 +577,7 @@ public final class OrderElementConverter {
}
}
} else { // orderElementDTO instanceof OrderLineGroupDTO
OrderVersion orderVersion = null;
if (orderElementDTO instanceof OrderDTO) {
if (!(orderElement instanceof Order)) {
throw new ValidationException(MessageFormat.format(
@ -586,7 +587,7 @@ public final class OrderElementConverter {
}
Order order = (Order) orderElement;
OrderVersion orderVersion = order.getOrderVersionFor(Registry
orderVersion = order.getOrderVersionFor(Registry
.getScenarioManager()
.getCurrent());
order.useSchedulingDataFor(orderVersion);
@ -636,8 +637,8 @@ public final class OrderElementConverter {
"Hours Group {0}: Duplicate code in DB",
childDTO.code));
}
((OrderLineGroup) orderElement).add(toEntity(childDTO,
configuration));
((OrderLineGroup) orderElement).add(toEntity(orderVersion,
childDTO, configuration));
}
}
@ -710,9 +711,8 @@ public final class OrderElementConverter {
.findByCode(orderElement.code);
return existsByCode != null;
} catch (InstanceNotFoundException e) {
e.printStackTrace();
return false;
}
return false;
}
/**
@ -739,7 +739,7 @@ public final class OrderElementConverter {
}
}
} catch (InstanceNotFoundException e) {
e.printStackTrace();
// Do nothing
}
return false;
}