Thread.java (Thread): Check for null "name" from start of private constructor...
authorBryce McKinlay <bryce@mckinlay.net.nz>
Thu, 7 Aug 2003 01:12:27 +0000 (01:12 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Thu, 7 Aug 2003 01:12:27 +0000 (02:12 +0100)
* java/lang/Thread.java (Thread): Check for null "name" from
start of private constructor, not after calling the private
constructor.

From-SVN: r70216

libjava/ChangeLog
libjava/java/lang/Thread.java

index f3ab9636bda180038233eccf73c30a3c8bee41a3..04307791bdee70b35f8e6e100a3b549f2fcfd6d3 100644 (file)
@@ -1,3 +1,9 @@
+2003-08-07  Bryce McKinlay  <bryce@mckinlay.net.nz>
+
+       * java/lang/Thread.java (Thread): Check for null "name" from
+       start of private constructor, not after calling the private
+       constructor.
+
 2003-08-06  Tom Tromey  <tromey@redhat.com>
 
        * java/io/FilePermission.java (equals): Use correct index for
index 32f7d174580f3a219845b681377d583091599639..64498b23ba438bdf9984d5d3cc4b8551430ffc2c 100644 (file)
@@ -614,11 +614,6 @@ public class Thread implements Runnable
   public Thread (ThreadGroup g, Runnable r, String n)
   {
     this (currentThread (), g, r, n);
-
-    // The Class Libraries book says ``threadName cannot be null''.  I
-    // take this to mean NullPointerException.
-    if (n == null)
-      throw new NullPointerException ();
   }
 
   /**
@@ -645,15 +640,15 @@ public class Thread implements Runnable
   {
     // Just ignore stackSize for now.
     this (currentThread (), g, r, n);
+  }
 
+  private Thread (Thread current, ThreadGroup g, Runnable r, String n)
+  {
     // The Class Libraries book says ``threadName cannot be null''.  I
     // take this to mean NullPointerException.
     if (n == null)
       throw new NullPointerException ();
-  }
-
-  private Thread (Thread current, ThreadGroup g, Runnable r, String n)
-  {
+      
     if (g == null)
       {
        // If CURRENT is null, then we are bootstrapping the first thread.