Author: deepak
Date: Tue Feb 19 18:05:43 2019
New Revision: 1853905

URL: http://svn.apache.org/viewvc?rev=1853905&view=rev
Log:
Improved: Updated code to fix some deprecated method call warnings 
(OFBIZ-10757)

Modified:
    
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
    
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
    
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
    
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/spreadsheetimport/ImportProductServices.java
    
ofbiz/ofbiz-framework/trunk/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java?rev=1853905&r1=1853904&r2=1853905&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
 Tue Feb 19 18:05:43 2019
@@ -2629,7 +2629,7 @@ public class OrderReturnServices {
         String settingPrefix = isSalesTax ? "salestax" : "order";
         String decimalsPrefix = isSalesTax ? ".calc" : "";
         int decimals = UtilNumber.getBigDecimalScale(settingPrefix + 
decimalsPrefix + ".decimals");
-        int rounding = UtilNumber.getRoundingMode(settingPrefix + 
".rounding").ordinal();
+        RoundingMode rounding = UtilNumber.getRoundingMode(settingPrefix + 
".rounding");
         returnTotal = returnTotal.setScale(decimals, rounding);
         originalTotal = originalTotal.setScale(decimals, rounding);
         BigDecimal newAmount = null;

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java?rev=1853905&r1=1853904&r2=1853905&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
 Tue Feb 19 18:05:43 2019
@@ -19,6 +19,7 @@
 package org.apache.ofbiz.order.shoppingcart.shipping;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -526,7 +527,7 @@ public class ShippingEvents {
         GenericValue shippingTimeEstimate = 
getShippingTimeEstimate(storeCarrierShipMethod, shippingTimeEstimates);
         if (shippingTimeEstimate == null) return null;
         BigDecimal leadTimeConverted = 
UomWorker.convertUom(shippingTimeEstimate.getBigDecimal("leadTime"), 
shippingTimeEstimate.getString("leadTimeUomId"), "TF_day", dispatcher);
-        return leadTimeConverted != null ? leadTimeConverted.setScale(2, 
BigDecimal.ROUND_UP).doubleValue() : null;
+        return leadTimeConverted != null ? leadTimeConverted.setScale(2, 
RoundingMode.UP).doubleValue() : null;
     }
 }
 

Modified: 
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java?rev=1853905&r1=1853904&r2=1853905&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
 Tue Feb 19 18:05:43 2019
@@ -599,7 +599,7 @@ public class PriceServices {
 
                 // based on the taxPercentage calculate the other amounts, 
including: listPrice, defaultPrice, averageCost, promoPrice, competitivePrice
                 BigDecimal taxPercentage = (BigDecimal) 
calcTaxForDisplayResult.get("taxPercentage");
-                BigDecimal taxMultiplier = 
ONE_BASE.add(taxPercentage.divide(PERCENT_SCALE, taxCalcScale));
+                BigDecimal taxMultiplier = 
ONE_BASE.add(taxPercentage.divide(PERCENT_SCALE, taxCalcScale, taxRounding));
                 if (result.get("listPrice") != null) {
                     result.put("listPrice", ((BigDecimal) 
result.get("listPrice")).multiply(taxMultiplier).setScale(taxFinalScale, 
taxRounding));
                 }

Modified: 
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/spreadsheetimport/ImportProductServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/spreadsheetimport/ImportProductServices.java?rev=1853905&r1=1853904&r2=1853905&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/spreadsheetimport/ImportProductServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/spreadsheetimport/ImportProductServices.java
 Tue Feb 19 18:05:43 2019
@@ -128,7 +128,7 @@ public class ImportProductServices {
                     // read QOH from ninth column
                     HSSFCell cell5 = row.getCell(5);
                     BigDecimal quantityOnHand = BigDecimal.ZERO;
-                    if (cell5 != null && cell5.getCellTypeEnum() == 
CellType.NUMERIC) {
+                    if (cell5 != null && cell5.getCellType() == 
CellType.NUMERIC) {
                         quantityOnHand = new 
BigDecimal(cell5.getNumericCellValue());
                     }
 

Modified: 
ofbiz/ofbiz-framework/trunk/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java?rev=1853905&r1=1853904&r2=1853905&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java
 Tue Feb 19 18:05:43 2019
@@ -58,7 +58,6 @@ public final class RemoveByAnd extends E
 
     @Override
     public boolean exec(MethodContext methodContext) throws MiniLangException {
-        @Deprecated
         String entityName = 
entityNameFse.expandString(methodContext.getEnvMap());
         if (entityName.isEmpty()) {
             throw new MiniLangRuntimeException("Entity name not found.", this);


Reply via email to