Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037966
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSminorhave not tried2018-02-19 11:382018-02-26 18:04
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in VersionRR18Q2
StatusclosedFix in branchFixed in SCM revision82ad7879d4d1
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037966: 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 ReproduceCompile with java9 and observe many new eclipse warnings related to BigDecimal
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0038337 closedgorka_gil Retail Modules make hardware manager compatible with java 9 - 11 
blocks feature request 0037083 closedalostale Openbravo ERP support JDK 9 

-  Notes
(0102486)
hgbot (developer)
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 (developer)
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 (developer)
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
---

- Issue History
Date Modified Username Field Change
2018-02-19 11:38 shuehner New Issue
2018-02-19 11:38 shuehner Assigned To => Retail
2018-02-19 11:38 shuehner Triggers an Emergency Pack => No
2018-02-19 11:39 shuehner Relationship added blocks 0037083
2018-02-19 11:54 shuehner Assigned To Retail => shuehner
2018-02-19 11:54 shuehner Review Assigned To => marvintm
2018-02-19 11:55 hgbot Checkin
2018-02-19 11:55 hgbot Note Added: 0102486
2018-02-19 11:56 hgbot Checkin
2018-02-19 11:56 hgbot Note Added: 0102487
2018-02-19 11:56 hgbot Status new => resolved
2018-02-19 11:56 hgbot Resolution open => fixed
2018-02-19 11:56 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/37b2e747d7324eb18e94e2528bb684a5eff85abb [^]
2018-02-19 12:20 hgbot Checkin
2018-02-19 12:20 hgbot Note Added: 0102490
2018-02-19 12:20 hgbot Fixed in SCM revision http://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:04 marvintm Status resolved => closed
2018-02-26 18:04 marvintm Fixed in Version => RR18Q2
2018-04-11 18:16 gorka_gil Relationship added related to 0038337


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker