8031050: (thread) Change Thread initialization so that thread name is set before invoking SecurityManager
authorchegar
Tue, 11 Feb 2014 11:22:20 +0000
changeset 23919 9377318e77ac
parent 23918 5f40f1d88890
child 23920 dc17ca1e4cf9
8031050: (thread) Change Thread initialization so that thread name is set before invoking SecurityManager Reviewed-by: alanb, dholmes, mchung
jdk/src/share/classes/java/lang/Thread.java
--- a/jdk/src/share/classes/java/lang/Thread.java	Wed Jan 29 15:53:25 2014 -0800
+++ b/jdk/src/share/classes/java/lang/Thread.java	Tue Feb 11 11:22:20 2014 +0000
@@ -366,6 +366,8 @@
             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 @@
         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