JDK-8290003 : Release Note: Thread Context ClassLoader Changed to be a Special Inheritable thread-local
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2022-07-08
  • Updated: 2023-08-28
  • Resolved: 2022-07-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19Resolved
Description
The thread context `ClassLoader` is specified in this release to be a special inheritable thread-local. This change should be transparent to existing code with the exception of code that uses the 5-arg `Thread` constructor (added in Java 9) to create a `Thread` that does not inherit the initial values of inheritable thread-locals from the constructing thread. With this release, invoking the 5-arg `Thread` constructor with the parameter `inheritInheritableThreadLocals` set to `false` will create a `Thread` that does not inherit the initial value of the context `ClassLoader` from the constructing thread. The `Thread.setContextClassLoader` method may be used to change the context `ClassLoader` of the new thread if needed.

For further details, see the [JEP 425, section Thread-local variables](https://openjdk.java.net/jeps/425#Thread-local-variables).