RFR: 8368500: ContextClassLoader cannot be reset on threads in ForkJoinPool.commonPool() [v4]

Viktor Klang vklang at openjdk.org
Thu Oct 23 12:47:14 UTC 2025


On Thu, 23 Oct 2025 12:27:42 GMT, Johny Jose <duke at openjdk.org> wrote:

>> The permanent disabling of the Security Manager in JDK 24  allow setCCL to set the CCL to a custom class loader. However, it doesn't allow it to be set to a custom class loader and then "reset" back to the system class loader before executing further code in the task. The changes are made to relax the restriction in setCCL to reset back to system class loader
>
> Johny Jose has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review changes to throw assertion error

test/jdk/java/util/concurrent/forkjoin/ContextClassLoaderTest.java line 55:

> 53: 
> 54:         try {
> 55:             future.get();

@johnyjose30 We don't need to inspect the exception here, we can make `testContextClassLoaderIsSetAndRestored` throws `Exception` and the test will fail if `future.get()` throws. (As any exception thrown is a test failure)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27648#discussion_r2455004601


More information about the core-libs-dev mailing list