8341989: [21u] Back out JDK-8327501 and JDK-8328366

Reviewed-by: goetz
This commit is contained in:
Christoph Langer
2024-10-11 21:37:47 +02:00
committed by Vitaly Provodin
parent 6de92fcf24
commit f8ebb02111
2 changed files with 3 additions and 9 deletions

View File

@@ -1140,7 +1140,9 @@ public class ForkJoinPool extends AbstractExecutorService {
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);

View File

@@ -79,9 +79,6 @@ public class ForkJoinPool9Test extends JSR166TestCase {
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
@@ -98,11 +95,6 @@ public class ForkJoinPool9Test extends JSR166TestCase {
() -> System.getProperty("foo"),
() -> currentThread.setContextClassLoader(
classLoaderDistinctFromSystemClassLoader));
else {
currentThread.setContextClassLoader(classLoaderDistinctFromSystemClassLoader);
assertSame(currentThread.getContextClassLoader(), classLoaderDistinctFromSystemClassLoader);
currentThread.setContextClassLoader(preexistingContextClassLoader);
}
// TODO ?
// if (haveSecurityManager
// && Thread.currentThread().getClass().getSimpleName()