--- /home/cpdev/src/classpath/java/util/logging/Logger.java	2005-07-15 17:32:40.000000000 +0000
+++ java/util/logging/Logger.java	2005-06-30 05:34:51.000000000 +0000
@@ -1,5 +1,5 @@
 /* Logger.java -- a class for logging messages
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -585,10 +585,10 @@
 			       String message,
 			       Object param)
   {
-    StackTraceElement caller = getCallerStackFrame();
+  	StackTraceElement caller = getCallerStackFrame();
     logp(level,
-	 caller != null ? caller.getClassName() : "<unknown>",
-	 caller != null ? caller.getMethodName() : "<unknown>",
+	 caller.getClassName(),
+	 caller.getMethodName(),
 	 message,
 	 param);
   }
@@ -600,8 +600,8 @@
   {
     StackTraceElement caller = getCallerStackFrame();
     logp(level,
-	 caller != null ? caller.getClassName() : "<unknown>",
-	 caller != null ? caller.getMethodName() : "<unknown>",
+	 caller.getClassName(),
+	 caller.getMethodName(),
 	 message,
 	 params);
   }
@@ -611,10 +611,10 @@
 			       String message,
 			       Throwable thrown)
   {
-    StackTraceElement caller = getCallerStackFrame();    
+	StackTraceElement caller = getCallerStackFrame();    
     logp(level,
-	 caller != null ? caller.getClassName() : "<unknown>",
-	 caller != null ? caller.getMethodName() : "<unknown>",
+	 caller.getClassName(),
+	 caller.getMethodName(),
 	 message,
 	 thrown);
   }
@@ -1146,8 +1146,13 @@
     lm = LogManager.getLogManager();
 
     if (this == lm.rootLogger)
+    {
+      if (parent != null)
         throw new IllegalArgumentException(
           "only the root logger can have a null parent");
+      this.parent = null;
+      return;
+    }
 
     /* An application is allowed to control an anonymous logger
      * without having the permission to control the logging
@@ -1162,38 +1167,7 @@
   /**
    * Gets the StackTraceElement of the first class that is not this class.
    * That should be the initial caller of a logging method.
-   * @return caller of the initial logging method or null if unknown.
+   * @return caller of the initial looging method
    */
-  private StackTraceElement getCallerStackFrame()
-  {
-    Throwable t = new Throwable();
-    StackTraceElement[] stackTrace = t.getStackTrace();
-    int index = 0;
-
-    // skip to stackentries until this class
-    while(index < stackTrace.length
-	  && !stackTrace[index].getClassName().equals(getClass().getName()))
-      index++;
-
-    // skip the stackentries of this class
-    while(index < stackTrace.length
-	  && stackTrace[index].getClassName().equals(getClass().getName()))
-      index++;
-
-    return index < stackTrace.length ? stackTrace[index] : null;
-  }
-  
-  /**
-   * Reset and close handlers attached to this logger. This function is package
-   * private because it must only be avaiable to the LogManager.
-   */
-  void resetLogger()
-  {
-    for (int i = 0; i < handlers.length; i++)
-      {
-        handlers[i].close();
-        handlerList.remove(handlers[i]);
-      }
-    handlers = getHandlers();
-  }
+  private native StackTraceElement getCallerStackFrame();
 }
