41 |
|
ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); |
42 |
|
boolean haveSecurityManager = (System.getSecurityManager() != null); |
43 |
|
CountDownLatch taskStarted = new CountDownLatch(1); |
44 |
+ |
ClassLoader classLoaderDistinctFromSystemClassLoader |
45 |
+ |
= ClassLoader.getPlatformClassLoader(); |
46 |
+ |
assertNotSame(classLoaderDistinctFromSystemClassLoader, |
47 |
+ |
systemClassLoader); |
48 |
|
Runnable runInCommonPool = () -> { |
49 |
|
taskStarted.countDown(); |
50 |
|
assertTrue(ForkJoinTask.inForkJoinPool()); |
58 |
|
assertThrows( |
59 |
|
SecurityException.class, |
60 |
|
() -> System.getProperty("foo"), |
61 |
< |
() -> Thread.currentThread().setContextClassLoader(null)); |
61 |
> |
() -> Thread.currentThread().setContextClassLoader( |
62 |
> |
classLoaderDistinctFromSystemClassLoader)); |
63 |
|
// TODO ? |
64 |
|
// if (haveSecurityManager |
65 |
|
// && Thread.currentThread().getClass().getSimpleName() |