Skip to content

Commit

Permalink
8341989: [21u] Back out JDK-8327501 and JDK-8328366
Browse files Browse the repository at this point in the history
Reviewed-by: goetz
  • Loading branch information
RealCLanger committed Oct 11, 2024
1 parent fb2af1c commit 9f9de26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,9 @@ public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
boolean isCommon = (pool.workerNamePrefix == null);
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null && isCommon)
if (sm == null)
return new ForkJoinWorkerThread(null, pool, true, false);
else if (isCommon)
return newCommonWithACC(pool);
else
return newRegularWithACC(pool);
Expand Down
8 changes: 0 additions & 8 deletions test/jdk/java/util/concurrent/tck/ForkJoinPool9Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public void testCommonPoolThreadContextClassLoader() throws Throwable {
assertSame(ForkJoinPool.commonPool(), ForkJoinTask.getPool());
Thread currentThread = Thread.currentThread();

ClassLoader preexistingContextClassLoader =
currentThread.getContextClassLoader();

Stream.of(systemClassLoader, null).forEach(cl -> {
if (randomBoolean())
// should always be permitted, without effect
Expand All @@ -98,11 +95,6 @@ public void testCommonPoolThreadContextClassLoader() throws Throwable {
() -> System.getProperty("foo"),
() -> currentThread.setContextClassLoader(
classLoaderDistinctFromSystemClassLoader));
else {
currentThread.setContextClassLoader(classLoaderDistinctFromSystemClassLoader);
assertSame(currentThread.getContextClassLoader(), classLoaderDistinctFromSystemClassLoader);
currentThread.setContextClassLoader(preexistingContextClassLoader);
}
// TODO ?
// if (haveSecurityManager
// && Thread.currentThread().getClass().getSimpleName()
Expand Down

0 comments on commit 9f9de26

Please sign in to comment.