details:   https://code.openbravo.com/erp/devel/pi/rev/91cc3fec7716
changeset: 33602:91cc3fec7716
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Sun Feb 18 19:15:11 2018 +0100
summary:   Issue 37964. Fix most of new JDK9 BigDecimal related deprecation 
warnings.

All changes are:
- BigDecimal.ROUND_HALF_UP -> RoundingMode.HALF_UP
- BigDecimal.ROUND_HALF_EVEN -> RoundingMode.HALF_EVEN
- BigDecimal.ROUND_CEILING -> RoundingMode.CEILING
- Adding java.math.RoundingMode import when required

details:   https://code.openbravo.com/erp/devel/pi/rev/bdaaadb9d483
changeset: 33603:bdaaadb9d483
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Thu Feb 22 10:49:57 2018 +0100
summary:   Related to Issue 37964. While setting the precission for a 
BigDecimal,
use the RoundingMode class to retrieve the precission instead of setting
the constant value manually. It makes the code easier to read by using
RoundingMode

details:   https://code.openbravo.com/erp/devel/pi/rev/5312e8108397
changeset: 33604:5312e8108397
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Thu Feb 22 11:33:30 2018 +0100
summary:   Related to Issue 37964.

Added missing RoundingMode (it was a mistake done by the developer, it was
intended to round to 2 decimals)
Changed wrong Logger class definitions

details:   https://code.openbravo.com/erp/devel/pi/rev/86709bedb772
changeset: 33605:86709bedb772
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Thu Feb 22 11:46:45 2018 +0100
summary:   Fixed 37965. Fix new jdk9 deprecation warnings (new Long, new 
Integer,...)

Replace the now deprecated constructors by equivalent use of
- typed constant: i.e. 10 by 10L (typed long)
- autoboxing
- Long Long.valueOf, long Long.parseInt

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java
                 |    3 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
                                  |    4 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java
                       |    8 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
                         |    2 +-
 
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java
                  |    6 +-
 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
    |    4 +-
 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
 |   17 +-
 src-test/src/org/openbravo/advpaymentmngt/test/FundsTransferTest.java          
                                                    |    7 +-
 src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_02.java             
                                                    |    6 +-
 src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_03.java             
                                                    |    2 +-
 src-test/src/org/openbravo/advpaymentmngt/test/TestUtility.java                
                                                    |    4 +-
 src-test/src/org/openbravo/test/costing/utils/TestCostingUtils.java            
                                                    |  221 +++++----
 src-test/src/org/openbravo/test/taxes/TaxesTest.java                           
                                                    |    3 +-
 src/org/openbravo/common/actionhandler/OrderCreatePOLines.java                 
                                                    |    5 +-
 src/org/openbravo/common/actionhandler/SRMOPickEditLines.java                  
                                                    |    5 +-
 src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java             
                                                    |    2 +-
 src/org/openbravo/common/actionhandler/SetNewBPCurrency.java                   
                                                    |    4 +-
 
src/org/openbravo/common/actionhandler/copyfromorderprocess/UpdatePricesAndAmounts.java
                                            |   11 +-
 src/org/openbravo/costing/AverageAlgorithm.java                                
                                                    |    2 +-
 src/org/openbravo/costing/CostingMigrationProcess.java                         
                                                    |    9 +-
 src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java               
                                                    |    9 +-
 src/org/openbravo/erpCommon/ad_actionButton/CopyFromOrder.java                 
                                                    |   11 +-
 src/org/openbravo/erpCommon/ad_actionButton/CreateFile.java                    
                                                    |   24 +-
 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java                    
                                                    |   15 +-
 src/org/openbravo/erpCommon/ad_actionButton/CreateRegFactAcct.java             
                                                    |    4 +-
 src/org/openbravo/erpCommon/ad_actionButton/CreateWorkEffort.java              
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder.java                 
                                                    |   13 +-
 src/org/openbravo/erpCommon/ad_callouts/SE_CalculateExchangeRate.java          
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Amount.java                 
                                                    |    5 +-
 src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Product.java                
                                                    |    5 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Conversion_Rate.java                
                                                    |    5 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java  
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_CreateLines_Conversion_UOM.java     
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java           
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java               
                                                    |    3 +-
 
src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java 
                                                   |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_InvAmtUpd_AmtUnitCost.java          
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java           
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_InvoiceTax_Amt.java                 
                                                    |    7 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java                    
                                                    |   20 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java             
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_JournalLineAmt.java                 
                                                    |    7 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_MachineCost.java                    
                                                    |   15 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java            
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java                      
                                                    |   32 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java               
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java                  
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Payment_Amounts.java                
                                                    |   15 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_ProductionPlan_Conversion.java      
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java          
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Project_Margin.java                 
                                                    |   19 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_Project_Planned.java                
                                                    |   11 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Amt.java            
                                                    |    9 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Conversion.java     
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java        
                                                    |    5 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java     
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_callouts/SL_WorkRequirement_Conversion.java     
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_forms/AcctServer.java                           
                                                    |   10 +-
 src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java                      
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java              
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java                        
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java                 
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_forms/DocInvoice.java                           
                                                    |   12 +-
 src/org/openbravo/erpCommon/ad_forms/DocLCCost.java                            
                                                    |    5 +-
 src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java                          
                                                    |    6 +-
 src/org/openbravo/erpCommon/ad_forms/FactLine.java                             
                                                    |   12 +-
 src/org/openbravo/erpCommon/ad_forms/MaterialReceiptPending.java               
                                                    |    5 +-
 src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java          
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_process/CreateCashFlowStatement.java            
                                                    |    3 +-
 src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java                   
                                                    |   13 +-
 src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java                     
                                                    |   11 +-
 src/org/openbravo/erpCommon/ad_reports/MInOutTraceReports.java                 
                                                    |   11 +-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java                
                                                    |    2 +-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java         
                                                    |    4 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java
                                             |    4 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_legacy.java
                                      |    4 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java
                                               |    4 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesJR.java 
                                                   |    4 +-
 src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceJR.java            
                                                    |    2 +-
 src/org/openbravo/erpCommon/ad_reports/ReportParetoProduct.java                
                                                    |    9 +-
 src/org/openbravo/erpCommon/ad_reports/ReportProjectProgress.java              
                                                    |   11 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR.java 
                                                   |    4 +-
 src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java    
                                                    |    4 +-
 src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR.java 
                                                    |    4 +-
 src/org/openbravo/erpCommon/businessUtility/COAUtility.java                    
                                                    |    2 +-
 src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility.java           
                                                    |    2 +-
 src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java               
                                                    |    5 +-
 src/org/openbravo/erpCommon/info/BusinessPartnerMultiple.java                  
                                                    |    4 +-
 src/org/openbravo/erpCommon/info/ProductMultiple.java                          
                                                    |    4 +-
 src/org/openbravo/erpCommon/info/ProjectMultiple.java                          
                                                    |    4 +-
 src/org/openbravo/erpReports/ReportVatRegisterJR.java                          
                                                    |    4 +-
 src/org/openbravo/event/ServiceRelationEventHandler.java                       
                                                    |    2 +-
 92 files changed, 427 insertions(+), 369 deletions(-)

diffs (truncated from 3247 to 300 lines):

diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java
        Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java
        Thu Feb 22 11:46:45 2018 +0100
@@ -20,6 +20,7 @@
 package org.openbravo.advpaymentmngt.actionHandler;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -133,7 +134,7 @@
           }
           int stdPrecision = 2;
           stdPrecision = currency.getStandardPrecision().intValue();
-          amount = amount.setScale(stdPrecision, BigDecimal.ROUND_HALF_UP);
+          amount = amount.setScale(stdPrecision, RoundingMode.HALF_UP);
           newDoubtfulDebt.setClient(doubtfulDebtRun.getClient());
           newDoubtfulDebt.setOrganization(doubtfulDebtRun.getOrganization());
           
newDoubtfulDebt.setAccountingDate(doubtfulDebtRun.getAccountingDate());
diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
 Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
 Thu Feb 22 11:46:45 2018 +0100
@@ -550,7 +550,7 @@
       if (vars != null) {
         DecimalFormat generalQtyRelationFmt = Utility.getFormat(vars, 
"generalQtyEdition");
         finTxnConvertRate = finTxnConvertRate.setScale(
-            generalQtyRelationFmt.getMaximumFractionDigits(), 
BigDecimal.ROUND_HALF_UP);
+            generalQtyRelationFmt.getMaximumFractionDigits(), 
RoundingMode.HALF_UP);
       }
     }
 
@@ -1391,7 +1391,7 @@
 
     BigDecimal overdueAmount = calculateOverdueAmount(invoicePaymentSchedule);
     invoice.setPercentageOverdue(overdueAmount.multiply(new BigDecimal("100"))
-        .divide(invoice.getGrandTotalAmount(), 2, 
BigDecimal.ROUND_HALF_UP).longValue());
+        .divide(invoice.getGrandTotalAmount(), 2, 
RoundingMode.HALF_UP).longValue());
 
     if (firstDueDate != null)
       invoice.setDaysTillDue(FIN_Utility.getDaysToDue(firstDueDate));
diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java
      Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java
      Thu Feb 22 11:46:45 2018 +0100
@@ -179,7 +179,7 @@
         grandTotalAmount = BigDecimal.ONE;
       }
       invoice.setPercentageOverdue(amounts.get("overdue").multiply(new 
BigDecimal(100))
-          .divide(grandTotalAmount, BigDecimal.ROUND_HALF_UP).longValue());
+          .divide(grandTotalAmount, RoundingMode.HALF_UP).longValue());
       invoice.setLastCalculatedOnDate(new Date());
 
       OBDal.getInstance().save(invoice);
@@ -426,10 +426,10 @@
       // payment amount * (generatedPaymentPaidAmount / 
generatedPaymentTotalAmount)
       BigDecimal paidAmountTmp = 
payment.getAmount().subtract(payment.getWriteoffAmount())
           .multiply(generatedPaymentPaidAmount)
-          .divide(generatedPaymentTotalAmount, BigDecimal.ROUND_HALF_UP);
+          .divide(generatedPaymentTotalAmount, RoundingMode.HALF_UP);
       // set scale of the currency using standard precision
       paidAmount = paidAmount.add(paidAmountTmp.setScale(payment.getCurrency()
-          .getStandardPrecision().intValue(), BigDecimal.ROUND_HALF_UP));
+          .getStandardPrecision().intValue(), RoundingMode.HALF_UP));
       // Add payment's write off amount to the paid amount
       paidAmount = paidAmount.add(getConvertedAmt(payment.getWriteoffAmount(), 
payment
           .getCurrency().getId(), strCurrencyTo, conversionDate, 
payment.getClient().getId(),
@@ -506,7 +506,7 @@
       }
       // payment amount * (generatedPaymentOverdueAmount / 
generatedPaymentTotalAmount)
       BigDecimal overdueAmountTmp = 
payment.getAmount().multiply(generatedPaymentOverdueAmount)
-          .divide(generatedPaymentTotalAmount, BigDecimal.ROUND_HALF_UP);
+          .divide(generatedPaymentTotalAmount, RoundingMode.HALF_UP);
       // set scale of the currency using standard precision
       overdueAmount = 
overdueAmount.add(overdueAmountTmp.setScale(payment.getCurrency()
           .getStandardPrecision().intValue(), RoundingMode.HALF_UP));
diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
        Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
        Thu Feb 22 11:46:45 2018 +0100
@@ -252,7 +252,7 @@
         }
         bankStatementLine.setBusinessPartner(businessPartner);
         bankStatementLine.setGLItem(glItem);
-        bankStatementLine.setLineNo(new Long((counter + 1) * 10));
+        bankStatementLine.setLineNo((counter + 1) * 10L);
         OBDal.getInstance().save(bankStatementLine);
         counter++;
       } else {
diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java
 Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java
 Thu Feb 22 11:46:45 2018 +0100
@@ -115,7 +115,7 @@
     if (nodes.size() > 0) {
       TreeNode node = nodes.get(0);
       node.setReportSet(!isNumber ? rootNode : parent_ID);
-      node.setSequenceNumber(new Long(seqNo));
+      node.setSequenceNumber(Long.valueOf(seqNo));
       OBDal.getInstance().save(node);
     } else {
       TreeNode treeElement = OBProvider.getInstance().get(TreeNode.class);
@@ -123,7 +123,7 @@
       treeElement.setNode(account.getId());
       treeElement.setTree(account.getAccountingElement().getTree());
       treeElement.setReportSet(!isNumber ? rootNode : parent_ID);
-      treeElement.setSequenceNumber(new Long(seqNo));
+      treeElement.setSequenceNumber(Long.valueOf(seqNo));
       OBDal.getInstance().save(treeElement);
     }
 
@@ -176,7 +176,7 @@
     OBCriteria<TreeNode> obc = 
OBDal.getInstance().createCriteria(TreeNode.class);
     obc.add(Restrictions.eq(TreeNode.PROPERTY_TREE, tree));
     obc.add(Restrictions.eq(TreeNode.PROPERTY_REPORTSET, parentID));
-    obc.add(Restrictions.ge(TreeNode.PROPERTY_SEQUENCENUMBER, new 
Long(seqNo)));
+    obc.add(Restrictions.ge(TreeNode.PROPERTY_SEQUENCENUMBER, 
Long.valueOf(seqNo)));
     obc.setFilterOnReadableClients(false);
     obc.setFilterOnReadableOrganization(false);
     for (TreeNode node : obc.list()) {
diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
   Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
   Thu Feb 22 11:46:45 2018 +0100
@@ -1007,8 +1007,8 @@
           Utility.messageBD(readOnlyCP, "No", vars.getLanguage()));
     }
 
-    parameters.put("ONE_ASTERISK_SHOW", new Boolean(showAsterisk(data, "*")));
-    parameters.put("TWO_ASTERISK_SHOW", new Boolean(showAsterisk(data, "**")));
+    parameters.put("ONE_ASTERISK_SHOW", showAsterisk(data, "*"));
+    parameters.put("TWO_ASTERISK_SHOW", showAsterisk(data, "**"));
 
     if (data != null) {
       renderJR(vars, response, strReportName, strOutput, parameters, data, 
null);
diff -r 4a1f3df29564 -r 86709bedb772 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
        Fri Feb 23 10:25:29 2018 +0100
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
        Thu Feb 22 11:46:45 2018 +0100
@@ -20,6 +20,7 @@
 package org.openbravo.financial.paymentreport.erpCommon.ad_reports;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -969,14 +970,14 @@
                   data,
                   "BASE_AMOUNT",
                   transAmount.multiply(convRate.getMultipleRateBy())
-                      .setScale(stdPrecission, 
BigDecimal.ROUND_HALF_UP).toString());
+                      .setScale(stdPrecission, 
RoundingMode.HALF_UP).toString());
             } else {
               FieldProviderFactory.setField(data, "TRANS_AMOUNT", 
transAmount.negate().toString());
               FieldProviderFactory.setField(
                   data,
                   "BASE_AMOUNT",
                   transAmount.multiply(convRate.getMultipleRateBy())
-                      .setScale(stdPrecission, 
BigDecimal.ROUND_HALF_UP).negate().toString());
+                      .setScale(stdPrecission, 
RoundingMode.HALF_UP).negate().toString());
             }
           } else {
             String message = transCurrency.getISOCode() + " -> " + 
baseCurrency.getISOCode() + " "
@@ -1020,7 +1021,7 @@
         if (convRate != null) {
           final int stdPrecission = 
convRate.getToCurrency().getStandardPrecision().intValue();
           balance = 
balance.multiply(convRate.getMultipleRateBy()).setScale(stdPrecission,
-              BigDecimal.ROUND_HALF_UP);
+              RoundingMode.HALF_UP);
         }
         FieldProviderFactory.setField(data, "BALANCE", balance.toString());
 
@@ -1077,13 +1078,13 @@
                     previousRow,
                     "BASE_AMOUNT",
                     amountSum.multiply(previousConvRate.getMultipleRateBy())
-                        .setScale(stdPrecission, 
BigDecimal.ROUND_HALF_UP).toString());
+                        .setScale(stdPrecission, 
RoundingMode.HALF_UP).toString());
               } else {
                 FieldProviderFactory.setField(
                     previousRow,
                     "BASE_AMOUNT",
                     amountSum.multiply(previousConvRate.getMultipleRateBy())
-                        .setScale(stdPrecission, 
BigDecimal.ROUND_HALF_UP).negate().toString());
+                        .setScale(stdPrecission, 
RoundingMode.HALF_UP).negate().toString());
               }
             }
 
@@ -1178,13 +1179,13 @@
                 previousRow,
                 "BASE_AMOUNT",
                 amountSum.multiply(previousConvRate.getMultipleRateBy())
-                    .setScale(stdPrecission, 
BigDecimal.ROUND_HALF_UP).toString());
+                    .setScale(stdPrecission, RoundingMode.HALF_UP).toString());
           } else {
             FieldProviderFactory.setField(
                 previousRow,
                 "BASE_AMOUNT",
                 amountSum.multiply(previousConvRate.getMultipleRateBy())
-                    .setScale(stdPrecission, 
BigDecimal.ROUND_HALF_UP).negate().toString());
+                    .setScale(stdPrecission, 
RoundingMode.HALF_UP).negate().toString());
           }
         }
 
@@ -1372,7 +1373,7 @@
             transactionData,
             "BASE_AMOUNT",
             transAmount.multiply(convRate.getMultipleRateBy())
-                .setScale(stdPrecission, BigDecimal.ROUND_HALF_UP).toString());
+                .setScale(stdPrecission, RoundingMode.HALF_UP).toString());
       } else {
         String message = transaction.getCurrency().getISOCode() + " -> "
             + baseCurrency.getISOCode() + " " + strConversionDate;
diff -r 4a1f3df29564 -r 86709bedb772 
src-test/src/org/openbravo/advpaymentmngt/test/FundsTransferTest.java
--- a/src-test/src/org/openbravo/advpaymentmngt/test/FundsTransferTest.java     
Fri Feb 23 10:25:29 2018 +0100
+++ b/src-test/src/org/openbravo/advpaymentmngt/test/FundsTransferTest.java     
Thu Feb 22 11:46:45 2018 +0100
@@ -24,6 +24,7 @@
 import static org.junit.Assert.fail;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Date;
 
 import org.apache.commons.lang.time.DateUtils;
@@ -153,7 +154,7 @@
         TRANSACTION_AMT, CONVERSION_RATE, null, null);
 
     BigDecimal convertedAmount = 
TRANSACTION_AMT.multiply(CONVERSION_RATE).setScale(2,
-        BigDecimal.ROUND_HALF_UP);
+        RoundingMode.HALF_UP);
 
     testTransactions(caja_clone, banco_gbp, TRANSACTION_AMT, null, 
convertedAmount, null);
   }
@@ -167,7 +168,7 @@
         TRANSACTION_AMT, null, null, null);
 
     BigDecimal convertedAmount = 
TRANSACTION_AMT.multiply(CONVERSION_RATE).setScale(2,
-        BigDecimal.ROUND_HALF_UP);
+        RoundingMode.HALF_UP);
 
     testTransactions(caja_clone, banco_gbp, TRANSACTION_AMT, null, 
convertedAmount, null);
   }
@@ -179,7 +180,7 @@
         TRANSACTION_AMT, CONVERSION_RATE, null, FEE_AMT_TO);
 
     BigDecimal convertedAmount = 
TRANSACTION_AMT.multiply(CONVERSION_RATE).setScale(2,
-        BigDecimal.ROUND_HALF_UP);
+        RoundingMode.HALF_UP);
 
     testTransactions(caja_clone, banco_gbp, TRANSACTION_AMT, null, 
convertedAmount, FEE_AMT_TO);
   }
diff -r 4a1f3df29564 -r 86709bedb772 
src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_02.java
--- a/src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_02.java        
Fri Feb 23 10:25:29 2018 +0100
+++ b/src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_02.java        
Thu Feb 22 11:46:45 2018 +0100
@@ -23,6 +23,7 @@
 import static org.junit.Assert.assertTrue;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Date;
 
 import org.apache.log4j.Logger;
@@ -56,7 +57,7 @@
  */
 public class PaymentTest_02 extends OBBaseTest {
 
-  private static final Logger log = Logger.getLogger(PaymentTest_01.class);
+  private static final Logger log = Logger.getLogger(PaymentTest_02.class);
 
   private static final String MANUAL_EXECUTION = "M";
   private static final String CLEARED_ACCOUNT = "CLE";
@@ -94,7 +95,8 @@
       // PAY PARTIALLY THE INVOICE
       invoice = OBDal.getInstance().get(Invoice.class, invoice.getId());
       BigDecimal divisor = new BigDecimal("2.0");
-      BigDecimal paymentAmount = invoice.getGrandTotalAmount().divide(divisor, 
2);
+      BigDecimal paymentAmount = invoice.getGrandTotalAmount().divide(divisor, 
2,
+          RoundingMode.HALF_UP);
       payment = TestUtility.addPaymentFromInvoice(invoice,
           OBDal.getInstance().get(FIN_FinancialAccount.class, 
financialAccountId), paymentAmount,
           false);
diff -r 4a1f3df29564 -r 86709bedb772 
src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_03.java
--- a/src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_03.java        
Fri Feb 23 10:25:29 2018 +0100
+++ b/src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_03.java        
Thu Feb 22 11:46:45 2018 +0100
@@ -55,7 +55,7 @@
  */
 public class PaymentTest_03 extends OBBaseTest {
 
-  private static final Logger log = Logger.getLogger(PaymentTest_01.class);
+  private static final Logger log = Logger.getLogger(PaymentTest_03.class);
 
   private static final String MANUAL_EXECUTION = "M";
   private static final String CLEARED_ACCOUNT = "CLE";
diff -r 4a1f3df29564 -r 86709bedb772 
src-test/src/org/openbravo/advpaymentmngt/test/TestUtility.java
--- a/src-test/src/org/openbravo/advpaymentmngt/test/TestUtility.java   Fri Feb 
23 10:25:29 2018 +0100
+++ b/src-test/src/org/openbravo/advpaymentmngt/test/TestUtility.java   Thu Feb 
22 11:46:45 2018 +0100
@@ -305,7 +305,7 @@
     orderLine.setOrderDate(orderDate);
     orderLine.setWarehouse(warehouse);
     orderLine.setCurrency(currency);
-    orderLine.setLineNo(new Long("10"));
+    orderLine.setLineNo(10L);
     orderLine.setProduct(product);
     orderLine.setUOM(uom);

------------------------------------------------------------------------------
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