Skip to content

Conversation

johnyjose30
Copy link
Contributor

@johnyjose30 johnyjose30 commented Oct 6, 2025

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


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8368500: ContextClassLoader cannot be reset on threads in ForkJoinPool.commonPool() (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27648/head:pull/27648
$ git checkout pull/27648

Update a local copy of the PR:
$ git checkout pull/27648
$ git pull https://git.openjdk.org/jdk.git pull/27648/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27648

View PR using the GUI difftool:
$ git pr show -t 27648

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27648.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 6, 2025

👋 Welcome back johnyjose30! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 6, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Oct 6, 2025

@johnyjose30 The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 6, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 6, 2025

Webrevs


@Test
void testContextClassLoaderIsSetAndRestored() throws InterruptedException {
CountDownLatch latch = new CountDownLatch(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like latch.await() is missing from the test.

if (customCCL instanceof URLClassLoader) {
((URLClassLoader) customCCL).close();
}
} catch (Exception ignored) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the customCCL.close, there are no JAR/other resources to close.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The src change looks okay but the test isn't quire right at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants