Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0037964 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] Z. Others | minor | have not tried | 2018-02-18 19:12 | 2018-03-02 21:18 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | Triage Omni OMS | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR18Q2 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 91cc3fec7716 | ||||
Projection | none | ETA | none | Target Version | 3.0PR18Q2 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | dmiguelez | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0037964: JDK 9: fix new BigDecimal related deprecation warnigns | |||||||
Description | JDK9 deprecated some constants in BigDecimal class related to rounding which are commonly used with the setScale & divide functions. However a simple replacement of the old constants with the new Enum Values is enough to fix this - BigDecimal.ROUND_HALF_UP -> RoundingMode.HALF_UP - BigDecimal.ROUND_HALF_EVEN -> RoundingMode.HALF_EVEN etc.. Note: That requires new import java.math.RoundingMode if not present. Because of the huge number of cases that can be faster + safer fixed half-automatically by doing a.) Search replace of UP,EVEN,CEILING cases of above in all java files b.) Adding missing import when required find . -name *.java | xargs -n1 sed -i 's#BigDecimal.ROUND_HALF_EVEN#RoundingMode.HALF_EVEN#' find . -name *.java | xargs -n1 sed -i 's#BigDecimal.ROUND_HALF_UP#RoundingMode.HALF_UP#' | |||||||
Steps To Reproduce | Compile with java9 and observe many new eclipse warnings related to BigDecimal | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||
|
Notes | |
(0102481) shuehner (administrator) 2018-02-18 19:13 |
Using above commands + adding manually import leads to following diffstat 64 files changed, 341 insertions(+), 288 deletions(-) That takes care about 99% of all cases except 4-5 files which don't use above constant but numeric magic-value for rounding which is probably bad style anyway. |
(0102818) hgbot (developer) 2018-02-23 11:21 |
Repository: erp/devel/pi Changeset: 91cc3fec7716f11eb9cba45fae6cef599250780f Author: Stefan Hühner <stefan.huehner <at> openbravo.com> Date: Sun Feb 18 19:15:11 2018 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/91cc3fec7716f11eb9cba45fae6cef599250780f [^] 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 --- M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java M modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java M src-test/src/org/openbravo/advpaymentmngt/test/FundsTransferTest.java M src-test/src/org/openbravo/test/costing/utils/TestCostingUtils.java M src-test/src/org/openbravo/test/taxes/TaxesTest.java M src/org/openbravo/common/actionhandler/OrderCreatePOLines.java M src/org/openbravo/common/actionhandler/SRMOPickEditLines.java M src/org/openbravo/common/actionhandler/ServiceOrderLineRelate.java M src/org/openbravo/common/actionhandler/copyfromorderprocess/UpdatePricesAndAmounts.java M src/org/openbravo/costing/AverageAlgorithm.java M src/org/openbravo/costing/CostingMigrationProcess.java M src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java M src/org/openbravo/erpCommon/ad_actionButton/CopyFromOrder.java M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java M src/org/openbravo/erpCommon/ad_actionButton/CreateWorkEffort.java M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder.java M src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Amount.java M src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Product.java M src/org/openbravo/erpCommon/ad_callouts/SL_CreateFromMultiple_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_CreateLines_Conversion_UOM.java M src/org/openbravo/erpCommon/ad_callouts/SL_GlobalUse_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_InOut_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_Internal_Consumption_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_InvAmtUpd_AmtUnitCost.java M src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_InvoiceTax_Amt.java M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_JournalLineAmt.java M src/org/openbravo/erpCommon/ad_callouts/SL_MachineCost.java M src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java M src/org/openbravo/erpCommon/ad_callouts/SL_ProductionPlan_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_Production_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_Project_Margin.java M src/org/openbravo/erpCommon/ad_callouts/SL_Project_Planned.java M src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Amt.java M src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java M src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Conversion.java M src/org/openbravo/erpCommon/ad_callouts/SL_WorkRequirement_Conversion.java M src/org/openbravo/erpCommon/ad_forms/AcctServer.java M src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java M src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java M src/org/openbravo/erpCommon/ad_forms/DocInvoice.java M src/org/openbravo/erpCommon/ad_forms/DocLCCost.java M src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java M src/org/openbravo/erpCommon/ad_forms/FactLine.java M src/org/openbravo/erpCommon/ad_forms/MaterialReceiptPending.java M src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java M src/org/openbravo/erpCommon/ad_process/CreateCashFlowStatement.java M src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java M src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java M src/org/openbravo/erpCommon/ad_reports/MInOutTraceReports.java M src/org/openbravo/erpCommon/ad_reports/ReportParetoProduct.java M src/org/openbravo/erpCommon/ad_reports/ReportProjectProgress.java M src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java M src/org/openbravo/event/ServiceRelationEventHandler.java --- |
(0102819) hgbot (developer) 2018-02-23 11:21 |
Repository: erp/devel/pi Changeset: bdaaadb9d483c6c7708477eeb9b19c875c019aad Author: David Miguelez <david.miguelez <at> openbravo.com> Date: Thu Feb 22 10:49:57 2018 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/bdaaadb9d483c6c7708477eeb9b19c875c019aad [^] 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 --- M src/org/openbravo/erpCommon/ad_callouts/SE_CalculateExchangeRate.java M src/org/openbravo/erpCommon/ad_callouts/SL_Conversion_Rate.java M src/org/openbravo/erpCommon/ad_callouts/SL_Payment_Amounts.java --- |
(0102820) hgbot (developer) 2018-02-23 11:21 |
Repository: erp/devel/pi Changeset: 5312e81083972045d1db1a804ccee1608339f61a Author: David Miguelez <david.miguelez <at> openbravo.com> Date: Thu Feb 22 11:33:30 2018 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/5312e81083972045d1db1a804ccee1608339f61a [^] 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 --- M src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_02.java M src-test/src/org/openbravo/advpaymentmngt/test/PaymentTest_03.java --- |
(0102822) dmiguelez (developer) 2018-02-23 11:22 |
Code Review + Testing Ok |
(0102948) hudsonbot (developer) 2018-03-02 21:18 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/05dece3dc80b [^] Maturity status: Test |
(0102949) hudsonbot (developer) 2018-03-02 21:18 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/05dece3dc80b [^] Maturity status: Test |
(0102950) hudsonbot (developer) 2018-03-02 21:18 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/05dece3dc80b [^] Maturity status: Test |
Issue History | |||
Date Modified | Username | Field | Change |
2018-02-18 19:12 | shuehner | New Issue | |
2018-02-18 19:12 | shuehner | Assigned To | => Triage Finance |
2018-02-18 19:12 | shuehner | Modules | => Core |
2018-02-18 19:12 | shuehner | Triggers an Emergency Pack | => No |
2018-02-18 19:12 | shuehner | Relationship added | blocks 0037083 |
2018-02-18 19:13 | shuehner | Note Added: 0102481 | |
2018-02-23 11:21 | hgbot | Checkin | |
2018-02-23 11:21 | hgbot | Note Added: 0102818 | |
2018-02-23 11:21 | hgbot | Checkin | |
2018-02-23 11:21 | hgbot | Note Added: 0102819 | |
2018-02-23 11:21 | hgbot | Checkin | |
2018-02-23 11:21 | hgbot | Note Added: 0102820 | |
2018-02-23 11:22 | dmiguelez | Status | new => scheduled |
2018-02-23 11:22 | dmiguelez | Status | scheduled => resolved |
2018-02-23 11:22 | dmiguelez | Fixed in SCM revision | => https://code.openbravo.com/erp/devel/pi/rev/91cc3fec7716f11eb9cba45fae6cef599250780f [^] |
2018-02-23 11:22 | dmiguelez | Resolution | open => fixed |
2018-02-23 11:22 | dmiguelez | Review Assigned To | => dmiguelez |
2018-02-23 11:22 | dmiguelez | Note Added: 0102822 | |
2018-02-23 11:22 | dmiguelez | Status | resolved => closed |
2018-02-23 11:22 | dmiguelez | Fixed in Version | => 3.0PR18Q2 |
2018-03-02 21:18 | hudsonbot | Checkin | |
2018-03-02 21:18 | hudsonbot | Note Added: 0102948 | |
2018-03-02 21:18 | hudsonbot | Checkin | |
2018-03-02 21:18 | hudsonbot | Note Added: 0102949 | |
2018-03-02 21:18 | hudsonbot | Checkin | |
2018-03-02 21:18 | hudsonbot | Note Added: 0102950 |
Copyright © 2000 - 2009 MantisBT Group |