Hi Jacques, Ashish

I also noted few classes with such patterns during clean up, and in first attempt I just cleaned the default TODOs.


I will provide a patch with this and other suggested enhancements.

Thanks & Regards,

Harsh


On Saturday 17 September 2016 04:56 PM, Jacques Le Roux wrote:
Hi Ashish,

This should be improved, exception in services should use Debug.logError, use return ServiceUtil.returnError and not swallow the exception


Le 17/09/2016 à 12:34, ash...@apache.org a écrit :
product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
          } catch (GenericEntityException e) {
-            // TODO Auto-generated catch block
              e.printStackTrace();
          }
if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG")) {
              try {
resultOutput = dispatcher.runSync("getMktgPackagesAvailable", contextInput);
              } catch (GenericServiceException e) {
-                // TODO Auto-generated catch block
                  e.printStackTrace();
              }
          } else {
              try {
resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", contextInput);
              } catch (GenericServiceException e) {
-                // TODO Auto-generated catch block
                  e.printStackTrace();
              }
          }
@@ -910,7 +898,6 @@ public class InventoryServices {
          try {
productPrices = EntityQuery.use(delegator).from("ProductPrice").where("productId",productId).orderBy("-fromDate").cache(true).queryList();
          } catch (GenericEntityException e) {
-            // TODO Auto-generated catch block
              e.printStackTrace();
          }
          //change this for product price
@@ -977,7 +964,6 @@ public class InventoryServices {
                      EntityOperator.AND);
salesUsageIt = EntityQuery.use(delegator).from(salesUsageViewEntity).where(cond).queryIterator();
              } catch (GenericEntityException e2) {
-                // TODO Auto-generated catch block
                  e2.printStackTrace();
              }
  @@ -996,7 +982,6 @@ public class InventoryServices {
              try {
                  salesUsageIt.close();
              } catch (GenericEntityException e2) {
-                // TODO Auto-generated catch block
                  e2.printStackTrace();
              }
  @@ -1013,7 +998,6 @@ public class InventoryServices {
                          EntityOperator.AND);
productionUsageIt = EntityQuery.use(delegator).from(productionUsageViewEntity).where(conditions).queryIterator();
              } catch (GenericEntityException e1) {
-                // TODO Auto-generated catch block
                  e1.printStackTrace();
              }
  @@ -1032,7 +1016,6 @@ public class InventoryServices {
              try {
                  productionUsageIt.close();
              } catch (GenericEntityException e) {
-                // TODO Auto-generated catch block
                  e.printStackTrace();
              }

Thanks!

Jacques


Reply via email to