8215359: InnocuousForkJoinWorkerThread.setContextClassLoader needlessly throws

Reviewed-by: martin, chegar, dholmes, reinhapa, alanb
This commit is contained in:
Doug Lea 2019-02-15 11:18:01 -08:00
parent 012c399c26
commit a7ab4d7bd3
2 changed files with 26 additions and 11 deletions

View file

@ -236,7 +236,8 @@ public class ForkJoinWorkerThread extends Thread {
@Override // paranoically
public void setContextClassLoader(ClassLoader cl) {
throw new SecurityException("setContextClassLoader");
if (cl != null && ClassLoader.getSystemClassLoader() != cl)
throw new SecurityException("setContextClassLoader");
}
}
}