Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037966Retail ModulesWeb POSpublic2018-02-19 11:382018-02-26 18:04
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
RR18Q2 
marvintm
No
0037966: JDK 9: fix new BigDecimal related deprecation warnigns
    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#'
Compile with java9 and observe many new eclipse warnings related to BigDecimal
No tags attached.
related to defect 0038337 closed gorka_gil Retail Modules make hardware manager compatible with java 9 - 11 
blocks feature request 0037083 closed alostale Openbravo ERP support JDK 9 
Issue History
2018-02-19 11:38shuehnerNew Issue
2018-02-19 11:38shuehnerAssigned To => Retail
2018-02-19 11:38shuehnerTriggers an Emergency Pack => No
2018-02-19 11:39shuehnerRelationship addedblocks 0037083
2018-02-19 11:54shuehnerAssigned ToRetail => shuehner
2018-02-19 11:54shuehnerReview Assigned To => marvintm
2018-02-19 11:55hgbotCheckin
2018-02-19 11:55hgbotNote Added: 0102486
2018-02-19 11:56hgbotCheckin
2018-02-19 11:56hgbotNote Added: 0102487
2018-02-19 11:56hgbotStatusnew => resolved
2018-02-19 11:56hgbotResolutionopen => fixed
2018-02-19 11:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/37b2e747d7324eb18e94e2528bb684a5eff85abb [^]
2018-02-19 12:20hgbotCheckin
2018-02-19 12:20hgbotNote Added: 0102490
2018-02-19 12:20hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/37b2e747d7324eb18e94e2528bb684a5eff85abb [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/82ad7879d4d1cb730bcca5fb6e7a2ab3c2a730d7 [^]
2018-02-26 18:04marvintmStatusresolved => closed
2018-02-26 18:04marvintmFixed in Version => RR18Q2
2018-04-11 18:16gorka_gilRelationship addedrelated to 0038337

Notes
(0102486)
hgbot   
2018-02-19 11:55   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: b8ff961b8b036aaba5b5133f59e6465a0e044d75
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Mon Feb 19 11:40:42 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/b8ff961b8b036aaba5b5133f59e6465a0e044d75 [^]

Issue 37966: Fix new jdk9 deprecation warning related to BigDecimal.

RoundingModes constants in BigDecimal have been deprecated and are replaced by
 usage of new RoundingMode enum.

---
M src/org/openbravo/retail/discounts/AddPack.java
---
(0102487)
hgbot   
2018-02-19 11:56   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 37b2e747d7324eb18e94e2528bb684a5eff85abb
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Mon Feb 19 11:43:00 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/37b2e747d7324eb18e94e2528bb684a5eff85abb [^]

Fixed 37966. Fix new JDK9 deprecation warnings related to BigDecimal.

JDK9 deprecates BigDecimal constants for rounding modes and replaces them
by a new enum RoundingMode.

---
M src/org/openbravo/retail/posterminal/CashCloseProcessor.java
M src/org/openbravo/retail/posterminal/ProcessCashMgmt.java
M src/org/openbravo/retail/posterminal/UpdateCashup.java
M src/org/openbravo/retail/posterminal/ad_reports/CashUpReport.java
M src/org/openbravo/retail/posterminal/term/CashCloseReport.java
---
(0102490)
hgbot   
2018-02-19 12:20   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 82ad7879d4d1cb730bcca5fb6e7a2ab3c2a730d7
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Mon Feb 19 12:19:44 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/82ad7879d4d1cb730bcca5fb6e7a2ab3c2a730d7 [^]

Fixed 37966. Fix another deprecated use of BigDecimal.divide

Code did use magic value 4 instead of proper constant ROUND_HALF_UP.
Replace it by constant and use the new RoundingMode.HALF_UP instead of the
old BigDecimal.ROUND_HALF_UP which is deprecated in jdk9.

---
M src/org/openbravo/retail/posterminal/term/Payments.java
---