Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045245Retail ModulesWeb POS Hardware Managerpublic2020-10-19 12:372020-10-22 17:32
shuehner 
cberner 
normalminorhave not tried
closedfixed 
5
 
RR21Q1 
No
0045245: hwmanager deprecation warnings when compiling with java11: finalize() in Object has been deprecated
Hardware manager still has some deprecation warnings left unfixed when compiling with Java>8

    [javac] org.openbravo.retail.poshwmanager.sources/project/src/com/openbravo/pos/printer/javapos/DeviceDisplayJavaPOS.java:107: warning: [deprecation] finalize() in Object has been deprecated
    [javac] public void finalize() throws Throwable {
    [javac] ^
    [javac] org.openbravo.retail.poshwmanager.sources/project/src/com/openbravo/pos/printer/javapos/DeviceDisplayJavaPOS.java:113: warning: [deprecation] finalize() in Object has been deprecated
    [javac] super.finalize();
    [javac] ^
    [javac] org.openbravo.retail.poshwmanager.sources/project/src/com/openbravo/pos/printer/javapos/DevicePrinterJavaPOS.java:378: warning: [deprecation] finalize() in Object has been deprecated
    [javac] public void finalize() throws Throwable {
    [javac] ^
    [javac] org.openbravo.retail.poshwmanager.sources/project/src/com/openbravo/pos/printer/javapos/DevicePrinterJavaPOS.java:394: warning: [deprecation] finalize() in Object has been deprecated
    [javac] super.finalize();
compile hardware manager with Java11
To get detailed warning output on commandline the following can be used
ant clean compile -Djavac.compilerargs="-Xlint:deprecation"
No tags attached.
blocks defect 0038337 closed gorka_gil make hardware manager compatible with java 9 - 11 
Issue History
2020-10-19 12:37shuehnerNew Issue
2020-10-19 12:37shuehnerAssigned To => Retail
2020-10-19 12:37shuehnerTriggers an Emergency Pack => No
2020-10-19 12:37shuehnerIssue generated from0045244
2020-10-19 12:37shuehnerRelationship addedblocks 0038337
2020-10-19 14:45shuehnerResolution time => 1606777200
2020-10-19 14:45shuehnerProposed Solution updated
2020-10-21 18:47cbernerAssigned ToRetail => cberner
2020-10-21 18:48hgbotNote Added: 0123828
2020-10-22 17:10hgbotResolutionopen => fixed
2020-10-22 17:10hgbotStatusnew => closed
2020-10-22 17:10hgbotFixed in Version => RR21Q1
2020-10-22 17:10hgbotNote Added: 0123882
2020-10-22 17:10hgbotNote Added: 0123883
2020-10-22 17:13hgbotNote Added: 0123884
2020-10-22 17:32hgbotNote Added: 0123887
2020-10-22 17:32hgbotNote Added: 0123888

Notes
(0123828)
hgbot   
2020-10-21 18:48   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager.sources/-/merge_requests/12 [^]
(0123882)
hgbot   
2020-10-22 17:10   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager.sources [^]
Changeset: 6b4ad3b758a5b22b91c592411bbf48b8dd7fb799
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-10-22T15:35:02+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager.sources/-/commit/6b4ad3b758a5b22b91c592411bbf48b8dd7fb799 [^]

Fixes ISSUE-45245: Deprecation warnings with Java 11 because of finalize method

Object.finalize() method has been deprecated since Java 9 and as such it
generates a warning when being used.
It was used in DevicePrinterJavaPOS and DeviceDisplayJavaPOS to release
several reserved resources when the Objects ceased to exist.

The alternative implemented here adds a new default close() method to the
interfaces DeviceDisplay, DevicePrinter and DeviceFiscalPrinter that
allows to close and release all those resources on a Runtime jvm
ShutDownHook. Effectively doing what the finalize method was doing previously
but more centralized.

---
M project/src/com/openbravo/pos/fiscal/DeviceFiscalActiveXEltrade.java
M project/src/com/openbravo/pos/printer/DeviceDisplay.java
M project/src/com/openbravo/pos/printer/DeviceFiscalPrinter.java
M project/src/com/openbravo/pos/printer/DevicePrinter.java
M project/src/com/openbravo/pos/printer/DeviceTicket.java
M project/src/com/openbravo/pos/printer/javapos/DeviceDisplayJavaPOS.java
M project/src/com/openbravo/pos/printer/javapos/DevicePrinterJavaPOS.java
M project/src/com/openbravo/poshw/Main.java
M project/src/com/openbravo/poshw/MainApp.java
---
(0123883)
hgbot   
2020-10-22 17:10   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager.sources/-/merge_requests/12 [^]
(0123884)
hgbot   
2020-10-22 17:13   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager/-/merge_requests/13 [^]
(0123887)
hgbot   
2020-10-22 17:32   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager [^]
Changeset: c22f2e2802d5166e45abc404c907899976ee9887
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-10-22T17:29:33+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager/-/commit/c22f2e2802d5166e45abc404c907899976ee9887 [^]

Related to ISSUE-45245: Deprecation warnings with Java 11 because of finalize method

Object.finalize() method has been deprecated since Java 9 and as such it
generates a warning when being used.
It was used in DevicePrinterJavaPOS and DeviceDisplayJavaPOS to release
several reserved resources when the Objects ceased to exist.

The alternative implemented here adds a new default close() method to the
interfaces DeviceDisplay, DevicePrinter and DeviceFiscalPrinter that
allows to close and release all those resources on a Runtime jvm
ShutDownHook. Effectively doing what the finalize method was doing previously
but more centralized.

---
M bin/poshw.jar
M bin/rev.id
---
(0123888)
hgbot   
2020-10-22 17:32   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.poshwmanager/-/merge_requests/13 [^]