Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0037965 | Openbravo ERP | Z. Others | public | 2018-02-19 11:34 | 2018-02-23 11:22 | |||||||
Reporter | shuehner | |||||||||||
Assigned To | Triage Omni OMS | |||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | 3.0PR18Q2 | ||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | dmiguelez | |||||||||||
OBNetwork customer | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0037965: JDK9: Fix new deprecation warnings related to: new Long, new Integer, new Boolean... | |||||||||||
Description | Java since long time had both: - new Integer(String - new Integer(int) but also - int Integer.parseInt - Integer Integer.valueOf With the latter being preferred (i.e. not constructing new instance for performance etc) JDK9 now deprecated those constructors. This issue fixes all cases in pi of the now deprecated usage by applying simple pattern depending on usage: a.) use java autoboxing where it converts from primitve to object automatically - bankStatementLine.setLineNo(new Long((counter + 1) * 10)); + bankStatementLine.setLineNo((counter + 1) * 10L); Note: 10 -> 10L to force use of type long and not int for resulting expression b.) when object is needed from String - node.setSequenceNumber(new Long(seqNo)); + node.setSequenceNumber(Long.valueOf(seqNo)); c.) auto-boxing with long constant - orderLine.setLineNo(new Long("10")); + orderLine.setLineNo(10L); d.) int from String- int comprobacion1 = new Integer(CreateFileData.selectComprobacion1(this, strKey)).intValue(); + int comprobacion1 = Integer.parseInt(CreateFileData.selectComprobacion1(this, strKey)); Note small special case: - assertEquals(costAdjustmentLine.getLineNo(), new Long((j + 1) * 10)); + assertEquals(costAdjustmentLine.getLineNo(), Long.valueOf((j + 1) * 10L)); Here simple auto-boxing did not compile cleanly Had to go via explicit Long object. | |||||||||||
Steps To Reproduce | Compile with JDK9 and observe new compilation warnings. | |||||||||||
Proposed Solution | ||||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2018-02-19 11:34 | shuehner | New Issue | ||||||||||
2018-02-19 11:34 | shuehner | Assigned To | => Triage Finance | |||||||||
2018-02-19 11:34 | shuehner | Modules | => Core | |||||||||
2018-02-19 11:34 | shuehner | Triggers an Emergency Pack | => No | |||||||||
2018-02-19 11:34 | shuehner | Relationship added | blocks 0037083 | |||||||||
2018-02-23 11:21 | hgbot | Checkin | ||||||||||
2018-02-23 11:21 | hgbot | Note Added: 0102821 | ||||||||||
2018-02-23 11:21 | hgbot | Status | new => resolved | |||||||||
2018-02-23 11:21 | hgbot | Resolution | open => fixed | |||||||||
2018-02-23 11:21 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/86709bedb772fb210f30b26c4e31dd36cfc54268 [^] | |||||||||
2018-02-23 11:22 | dmiguelez | Review Assigned To | => dmiguelez | |||||||||
2018-02-23 11:22 | dmiguelez | Note Added: 0102823 | ||||||||||
2018-02-23 11:22 | dmiguelez | Status | resolved => closed | |||||||||
2018-02-23 11:22 | dmiguelez | Fixed in Version | => 3.0PR18Q2 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|