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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0049435
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2022-05-30 08:372022-10-04 08:19
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in VersionPR23Q1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0049435: don't use java.lang.ThreadGroup

DescriptionIn JDK19's JEP 425: Virtual Threads (Preview), there is a section for ThreadGroup where they comment:

"
java.lang.ThreadGroup is a legacy API for grouping threads that is rarely used in modern applications and unsuitable for grouping virtual threads. We deprecate and degrade it now, and expect to introduce a new thread-organizing construct in the future as part of structured concurrency.
"


We should prevent using it.

---
[1] https://openjdk.java.net/jeps/425#java-lang-ThreadGroup [^]
Steps To ReproduceIt is currently used in ImportEntryManager and ClusterServiceManager.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks feature request 0049432 newTriage Platform Base Support JDK19 

-  Notes
(0139728)
shuehner (administrator)
2022-07-29 13:28

Adding SLA date after checking ALO/SHU
(0141533)
hgbot (developer)
2022-09-30 08:23

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/720 [^]
(0141620)
hgbot (developer)
2022-10-04 08:19

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/720 [^]
(0141621)
hgbot (developer)
2022-10-04 08:19

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 83995fe261a9eaeeae0e83108785e94803d48c85
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 04-10-2022 06:19:26
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/83995fe261a9eaeeae0e83108785e94803d48c85 [^]

fixes ISSUE-49435: prevents using legacy ThreadGroup

The only direct use in the code was to assign the newly created thread
to the group, which was obtainged from the current thread that was
creaing the new thread.

The Thread super constructor we are using Thread(ThreadGroup, Runnable, String name, long)
documents [1] that if the group is null and there is no security manager,
the group is set to the current thread's thread group. Which is, in
practice, the same that was done before. Also the stackSize parameter
was always 0 which indicates to be ignored.

Taking into account all this, it is possible to use the simpler
constructor Thread(Runnable target, String name).

---
[1] https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Thread.html#%3Cinit%3E(java.lang.ThreadGroup,java.lang.Runnable,java.lang.String,long) [^]

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

- Issue History
Date Modified Username Field Change
2022-05-30 08:37 alostale New Issue
2022-05-30 08:37 alostale Assigned To => Triage Platform Base
2022-05-30 08:37 alostale Modules => Core
2022-05-30 08:37 alostale Triggers an Emergency Pack => No
2022-05-30 08:37 alostale Type defect => design defect
2022-05-30 08:37 alostale Relationship added blocks 0049432
2022-07-29 13:28 shuehner Note Added: 0139728
2022-07-29 13:28 shuehner Target Version => PR22Q4
2022-09-29 14:16 alostale Assigned To Triage Platform Base => caristu
2022-09-29 17:37 shuehner Target Version PR22Q4 =>
2022-09-29 17:37 shuehner Issue Monitored: shuehner
2022-09-30 08:23 hgbot Note Added: 0141533
2022-09-30 10:34 caristu Assigned To caristu => alostale
2022-10-04 08:19 hgbot Note Added: 0141620
2022-10-04 08:19 hgbot Resolution open => fixed
2022-10-04 08:19 hgbot Status new => closed
2022-10-04 08:19 hgbot Fixed in Version => PR23Q1
2022-10-04 08:19 hgbot Note Added: 0141621


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker