8031050: (thread) Change Thread initialization so that thread name is set before invoking SecurityManager

Reviewed-by: alanb, dholmes, mchung
This commit is contained in:
Chris Hegarty 2014-02-11 11:22:20 +00:00
parent e833046b55
commit a933426ce6

View File

@ -366,6 +366,8 @@ class Thread implements Runnable {
throw new NullPointerException("name cannot be null");
}
this.name = name.toCharArray();
Thread parent = currentThread();
SecurityManager security = System.getSecurityManager();
if (g == null) {
@ -402,7 +404,6 @@ class Thread implements Runnable {
this.group = g;
this.daemon = parent.isDaemon();
this.priority = parent.getPriority();
this.name = name.toCharArray();
if (security == null || isCCLOverridden(parent.getClass()))
this.contextClassLoader = parent.getContextClassLoader();
else