11 |
|
import java.util.concurrent.ForkJoinPool; |
12 |
|
import java.util.concurrent.ForkJoinTask; |
13 |
|
import java.util.concurrent.Future; |
14 |
– |
import java.util.concurrent.ThreadLocalRandom; |
14 |
|
import java.util.stream.Stream; |
15 |
|
|
16 |
|
import junit.framework.Test; |
53 |
|
Thread currentThread = Thread.currentThread(); |
54 |
|
|
55 |
|
Stream.of(systemClassLoader, null).forEach(cl -> { |
56 |
< |
if (ThreadLocalRandom.current().nextBoolean()) |
56 |
> |
if (randomBoolean()) |
57 |
|
// should always be permitted, without effect |
58 |
|
currentThread.setContextClassLoader(cl); |
59 |
|
}); |