if (parent != rootLogger)
if (parent != Logger.root)
  public synchronized boolean addLogger(Logger logger)  {    /* To developers thinking about to remove the 'synchronized'     * declaration from this method: Please read the comment     * in java.util.logging.Logger.getLogger(String, String)     * and make sure that whatever you change wrt. synchronization     * does not endanger thread-safety of Logger.getLogger.     * The current implementation of Logger.getLogger assumes     * that LogManager does its synchronization on the globally     * shared instance of LogManager.     */    String name;    WeakReference  ref;    /* This will throw a NullPointerException if logger is null,     * as required by the API specification.     */    name = logger.getName();    ref = (WeakReference) loggers.get(name);    if (ref != null)    {      if (ref.get() != null)	return false;      /* There has been a logger under this name in the past,       * but it has been garbage collected.       */      loggers.remove(ref);    }    /* Adding a named logger requires a security permission. */    if ((name != null) && ! name.equals(""))      checkAccess();    Logger parent = findAncestor(logger);    loggers.put(name, new WeakReference(logger));    if (parent != logger.getParent())      logger.setParent(parent);    // The level of the newly added logger must be specified.    // The easiest case is if there is a level for exactly this logger    // in the properties. If no such level exists the level needs to be     // searched along the hirachy. So if there is a new logger 'foo.blah.blub'    // and an existing parent logger 'foo' the properties 'foo.blah.blub.level'    // and 'foo.blah.level' need to be checked. If both do not exist in the     // properties the level of the new logger is set to 'null' (i.e. it uses the    // level of its parent 'foo').    Level logLevel = logger.getLevel();    String searchName = name;    String parentName = parent != null ? parent.getName() : "";    while (logLevel == null && ! searchName.equals(parentName))      {        logLevel = getLevelProperty(searchName + ".level", logLevel);        int index = searchName.lastIndexOf('.');        if(index > -1)          searchName = searchName.substring(0,index);        else          searchName = "";            }    logger.setLevel(logLevel);    /* It can happen that existing loggers should be children of     * the newly added logger. For example, assume that there     * already exist loggers under the names "", "foo", and "foo.bar.baz".     * When adding "foo.bar", the logger "foo.bar.baz" should change     * its parent to "foo.bar".     */    if (parent != rootLogger)    {      for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();)      {	    Logger possChild = (Logger) ((WeakReference) loggers.get(iter.next()))	                       .get();	    if ((possChild == null) || (possChild == logger)	        || (possChild.getParent() != parent))	  continue;	    if (! possChild.getName().startsWith(name))	  continue;	if (possChild.getName().charAt(name.length()) != '.')	  continue;	possChild.setParent(logger);      }    }    return true;  }