details:   https://code.openbravo.com/erp/devel/pi/rev/f06d1fb9752b
changeset: 32438:f06d1fb9752b
user:      Armaignac <collazoandy4 <at> gmail.com>
date:      Mon Jul 10 12:49:45 2017 +0200
summary:   Fixes issue 36392: Avoid casting when adding numeric results in 
SimpleCallout

The casting to Object was replace by a integer conversion, sending the
corresponding numeric value when it applies.

diffstat:

 src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java |  8 ++++----
 src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java |  4 ++--
 src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java  |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diffs (72 lines):

diff -r 278f3a69030d -r f06d1fb9752b 
src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java Mon Jul 
10 12:26:51 2017 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java Mon Jul 
10 12:49:45 2017 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2016 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2017 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -118,7 +118,7 @@
 
     if (isUomManagementEnabled && "".equals(strUOMProduct)) {
       // Set AUM based on default
-      try{
+      try {
         OBContext.setAdminMode();
         ShipmentInOut mInOut = OBDal.getInstance().get(ShipmentInOut.class,
             info.vars.getStringParameter("inpmInoutId"));
@@ -127,7 +127,7 @@
         if (finalAUM != null) {
           info.addResult("inpcAum", finalAUM);
         }
-      }finally{
+      } finally {
         OBContext.restorePreviousMode();
       }
     }
@@ -137,7 +137,7 @@
     if (strHasSecondaryUOM.equals("1")
         && (!isUomManagementEnabled || (isUomManagementEnabled && 
!"".equals(strUOMProduct)))) {
       String strPUOM = info.vars.getStringParameter("inpmProductId_PUOM");
-      info.addResult("inphasseconduom", (Object) strHasSecondaryUOM);
+      info.addResult("inphasseconduom", Integer.parseInt(strHasSecondaryUOM));
 
       if (strPUOM.startsWith("\"")) {
         strPUOM = strPUOM.substring(1, strPUOM.length() - 1);
diff -r 278f3a69030d -r f06d1fb9752b 
src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java Mon Jul 
10 12:26:51 2017 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java Mon Jul 
10 12:49:45 2017 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2016 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2017 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -86,7 +86,7 @@
     // Secondary UOM
 
     String strHasSecondaryUOM = SLOrderProductData.hasSecondaryUOM(this, 
strMProductID);
-    info.addResult("inphasseconduom", (Object) strHasSecondaryUOM);
+    info.addResult("inphasseconduom", Integer.parseInt(strHasSecondaryUOM));
 
     // Quantity order
 
diff -r 278f3a69030d -r f06d1fb9752b 
src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java  Mon Jul 
10 12:26:51 2017 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java  Mon Jul 
10 12:49:45 2017 +0200
@@ -100,7 +100,7 @@
     String strPUOM = info.vars.getStringParameter("inpmProductId_PUOM");
 
     String strHasSecondaryUOM = SLOrderProductData.hasSecondaryUOM(this, 
strMProductID);
-    info.addResult("inphasseconduom", (Object) strHasSecondaryUOM);
+    info.addResult("inphasseconduom", Integer.parseInt(strHasSecondaryUOM));
 
     if (strPUOM.startsWith("\"")) {
       strPUOM = strPUOM.substring(1, strPUOM.length() - 1);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to