diff --git a/src/share/classes/java/lang/Thread.java b/src/share/classes/java/lang/Thread.java index 13d8ac26cad192ff98d8ca4d2f26830992e3de90..274801cea6c585a9f7b9f5ebd30298868ac4fa0f 100644 --- a/src/share/classes/java/lang/Thread.java +++ b/src/share/classes/java/lang/Thread.java @@ -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