svn commit: r1820385 - /ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1820385 - /ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java

jleroux@apache.org
Author: jleroux
Date: Sat Jan  6 12:02:05 2018
New Revision: 1820385

URL: http://svn.apache.org/viewvc?rev=1820385&view=rev
Log:
Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

This was missing in r1804953 and it's now a good opportunity to test the new
ofbizTrunkFrameworkPlugins builder alone

Modified:
    ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java?rev=1820385&r1=1820384&r2=1820385&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java Sat Jan  6 12:02:05 2018
@@ -207,10 +207,10 @@ public final class ProductUtil {
 
                 if (product != null && "AGGREGATED".equals(product.getString("productTypeId"))) {
                     ProductConfigWrapper configWrapper = new ProductConfigWrapper(delegator, dispatcher, productId, null, null, null, null, locale, userLogin);
-                    String listPrice = configWrapper.getTotalListPrice().setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
+                    String listPrice = configWrapper.getTotalListPrice().setScale(2, RoundingMode.HALF_DOWN).toString();
                     if (listPrice != null)
                         dispatchContext.put("listPrice", listPrice);
-                    String defaultPrice = configWrapper.getTotalListPrice().setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
+                    String defaultPrice = configWrapper.getTotalListPrice().setScale(2, RoundingMode.HALF_DOWN).toString();
                     if (defaultPrice != null)
                         dispatchContext.put("defaultPrice", defaultPrice);
                 } else {
@@ -220,11 +220,11 @@ public final class ProductUtil {
                         return ServiceUtil.returnError(ServiceUtil.getErrorMessage(priceMap));
                     }
                     if (priceMap.get("listPrice") != null) {
-                        String listPrice = ((BigDecimal) priceMap.get("listPrice")).setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
+                        String listPrice = ((BigDecimal) priceMap.get("listPrice")).setScale(2, RoundingMode.HALF_DOWN).toString();
                         dispatchContext.put("listPrice", listPrice);
                     }
                     if (priceMap.get("defaultPrice") != null) {
-                        String defaultPrice = ((BigDecimal) priceMap.get("defaultPrice")).setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
+                        String defaultPrice = ((BigDecimal) priceMap.get("defaultPrice")).setScale(2, RoundingMode.HALF_DOWN).toString();
                         if (defaultPrice != null)
                             dispatchContext.put("defaultPrice", defaultPrice);
                     }