Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047013Openbravo ERPA. Platformpublic2021-06-08 08:552021-06-15 18:27
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
PR21Q3 
Core
No
0047013: JDK17 deprecation for removal warnings
Compiling Openbravo with JDK17 (currently ea25) a few deprecation for removal warnings appear.
* Compile Using JDK17 (ea25)
  In src-core:

    [javac] /home/alostale/ws/projects/stack/openbravo/src-core/src/org/openbravo/base/ConfigParameters.java:164: warning: [removal] AccessControlException in java.security has been deprecated and marked for removal
    [javac] } catch (java.security.AccessControlException err) {
    [javac] ^
    [javac] 1 warning

  In openbravo core:
    [javac] /home/alostale/ws/projects/stack/openbravo/src/org/openbravo/cluster/ClusterServiceManager.java:110: warning: [removal] SecurityManager in java.lang has been deprecated and marked for removal
    [javac] SecurityManager s = System.getSecurityManager();
    [javac] ^
    [javac] /home/alostale/ws/projects/stack/openbravo/src/org/openbravo/cluster/ClusterServiceManager.java:110: warning: [removal] getSecurityManager() in System has been deprecated and marked for removal
    [javac] SecurityManager s = System.getSecurityManager();
    [javac] ^
    [javac] /home/alostale/ws/projects/stack/openbravo/src/org/openbravo/service/importprocess/ImportEntryManager.java:751: warning: [removal] SecurityManager in java.lang has been deprecated and marked for removal
    [javac] SecurityManager s = System.getSecurityManager();
    [javac] ^
    [javac] /home/alostale/ws/projects/stack/openbravo/src/org/openbravo/service/importprocess/ImportEntryManager.java:751: warning: [removal] getSecurityManager() in System has been deprecated and marked for removal
    [javac] SecurityManager s = System.getSecurityManager();

No tags attached.
related to feature request 0045903 new Triage Platform Base Support JDK17 (LTS) 
Issue History
2021-06-08 08:55alostaleNew Issue
2021-06-08 08:55alostaleAssigned To => platform
2021-06-08 08:55alostaleModules => Core
2021-06-08 08:55alostaleTriggers an Emergency Pack => No
2021-06-08 08:56alostaleRelationship addedrelated to 0045903
2021-06-08 08:56alostaleStatusnew => acknowledged
2021-06-08 14:30shuehnerNote Added: 0129187
2021-06-09 08:48alostaleStatusacknowledged => scheduled
2021-06-09 08:48alostaleAssigned Toplatform => alostale
2021-06-09 09:07hgbotNote Added: 0129223
2021-06-15 18:27hgbotNote Added: 0129526
2021-06-15 18:27hgbotResolutionopen => fixed
2021-06-15 18:27hgbotStatusscheduled => closed
2021-06-15 18:27hgbotFixed in Version => PR21Q3
2021-06-15 18:27hgbotNote Added: 0129527

Notes
(0129187)
shuehner   
2021-06-08 14:30   
For the ConfigParameters part:

https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/base/secureApp/VariablesSecureApp.java#L71 [^]

In that other file we read the same 2 properties already without the extra protection. So should be fine to just drop the extra try/catch without any loss of functionality in practice.
(0129223)
hgbot   
2021-06-09 09:07   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/382 [^]
(0129526)
hgbot   
2021-06-15 18:27   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/382 [^]
(0129527)
hgbot   
2021-06-15 18:27   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: f5333ef320e9429cc986805b3c68b847a216f417
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-06-15T16:24:32+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/f5333ef320e9429cc986805b3c68b847a216f417 [^]

fixed ISSUE-47013: JDK17+ depreaction for removal warnings

JEP 411 [1] Deprecate the Security Manager for Removal, affects a few
cases which are now fixed:

  * ImportEntryManager and ClusterServiceManager used
    SecurityManager.getThreadGroup() method in case there was a
    SecurityManager other ways it took current thread's. In most of the
    cases security manager wasn't configured so current thred's was
    taken anyway in addition, default SecurityManager's implementation
    also returns current thread's group. It has changed now to always
    take current thread's without additional checks.

  * ConfigParameters catched the, now deprecated, java.security.AccessControlException
    which can be thrown by System.getPropery if SecurityManager is
    configured to prevent this property to be got. In other places we
    are not performing this check, so it is safe to be removed also from
    here.

---
[1] https://openjdk.java.net/jeps/411 [^]

---
M src-core/src/org/openbravo/base/ConfigParameters.java
M src/org/openbravo/cluster/ClusterServiceManager.java
M src/org/openbravo/service/importprocess/ImportEntryManager.java
---