Fixed: Fix Default or Empty Catch block in Java files
Removes 2 swallowed exceptions, refactors
@@ -257,14 +257,12 @@ public class MrpServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpEventFindError", locale));
}
for (GenericValue genericResult : resultList) {
+ try {
String newOrderId = genericResult.getString("orderId");
if (!newOrderId.equals(orderId)) {
orderDeliverySchedule = null;
orderId = newOrderId;
- try {
orderDeliverySchedule = EntityQuery.use(delegator).from("OrderDeliverySchedule").where("orderId", orderId, "orderItemSeqId", "_NA_").queryOne();
- } catch (GenericEntityException e) {
- }
}
String productId = genericResult.getString("productId");
@@ -279,19 +277,13 @@ public class MrpServices {
OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
BigDecimal shippedQuantity = null;
- try {
shippedQuantity = orh.getItemShippedQuantity(genericResult.getRelatedOne("OrderItem", false));
- } catch (GenericEntityException e) {
- }
if (UtilValidate.isNotEmpty(shippedQuantity)) {
shipGroupQuantity = shipGroupQuantity.subtract(shippedQuantity);
}
GenericValue orderItemDeliverySchedule = null;
- try {
orderItemDeliverySchedule = EntityQuery.use(delegator).from("OrderDeliverySchedule").where("orderId", orderId, "orderItemSeqId", genericResult.getString("orderItemSeqId")).queryOne();
- } catch (GenericEntityException e) {
- }
Timestamp estimatedShipDate = null;
if (orderItemDeliverySchedule != null && orderItemDeliverySchedule.get("estimatedReadyDate") != null) {
estimatedShipDate = orderItemDeliverySchedule.getTimestamp("estimatedReadyDate");
@@ -305,7 +297,6 @@ public class MrpServices {
}
parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", estimatedShipDate, "mrpEventTypeId", "PUR_ORDER_RECP");
- try {
InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, shipGroupQuantity, null, genericResult.getString("orderId") + "-" + genericResult.getString("orderItemSeqId"), false, delegator);
} catch (GenericEntityException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpEventProblemInitializing", UtilMisc.toMap("mrpEventTypeId", "PUR_ORDER_RECP"), locale));
