8271624: Avoid unnecessary ThreadGroup.checkAccess calls when creating Threads

Reviewed-by: rriggs
This commit is contained in:
Claes Redestad 2021-08-02 22:59:48 +00:00
parent e621cffa4f
commit 0b9539405d

View file

@ -417,14 +417,14 @@ public class Thread implements Runnable {
}
}
/* checkAccess regardless of whether or not threadgroup is
explicitly passed in. */
g.checkAccess();
/*
* Do we have the required permissions?
*/
if (security != null) {
/* checkAccess regardless of whether or not threadgroup is
explicitly passed in. */
security.checkAccess(g);
if (isCCLOverridden(getClass())) {
security.checkPermission(
SecurityConstants.SUBCLASS_IMPLEMENTATION_PERMISSION);