/[classpath]/classpath/java/util/logging/LogManager.java
ViewVC logotype

Diff of /classpath/java/util/logging/LogManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by mkoch, Sat Apr 17 19:23:19 2004 UTC revision 1.9.2.1 by gnu_andrew, Sat Jan 15 17:02:16 2005 UTC
# Line 1  Line 1 
1  /* LogManager.java  /* LogManager.java -- a class for maintaining Loggers and managing
2     -- a class for maintaining Loggers and managing configuration     configuration properties
3        properties     Copyright (C) 2002 Free Software Foundation, Inc.
   
 Copyright (C) 2002 Free Software Foundation, Inc.  
4    
5  This file is part of GNU Classpath.  This file is part of GNU Classpath.
6    
# Line 36  module.  An independent module is a modu Line 34  module.  An independent module is a modu
34  or based on this library.  If you modify this library, you may extend  or based on this library.  If you modify this library, you may extend
35  this exception to your version of the library, but you are not  this exception to your version of the library, but you are not
36  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
37  exception statement from your version.  exception statement from your version. */
38    
 */  
39    
40  package java.util.logging;  package java.util.logging;
41    
# Line 46  import java.beans.PropertyChangeListener Line 43  import java.beans.PropertyChangeListener
43  import java.beans.PropertyChangeSupport;  import java.beans.PropertyChangeSupport;
44  import java.io.IOException;  import java.io.IOException;
45  import java.io.InputStream;  import java.io.InputStream;
46    import java.lang.ref.WeakReference;
47  import java.net.URL;  import java.net.URL;
48  import java.util.Collections;  import java.util.Collections;
 import java.util.Properties;  
49  import java.util.Enumeration;  import java.util.Enumeration;
50  import java.util.Iterator;  import java.util.Iterator;
51  import java.util.Map;  import java.util.Map;
52    import java.util.Properties;
53  import java.util.StringTokenizer;  import java.util.StringTokenizer;
 import java.lang.ref.WeakReference;  
54    
55  /**  /**
56   * The <code>LogManager</code> maintains a hierarchical namespace   * The <code>LogManager</code> maintains a hierarchical namespace
# Line 351  public class LogManager Line 348  public class LogManager
348    private synchronized Logger findAncestor(Logger child)    private synchronized Logger findAncestor(Logger child)
349    {    {
350      String childName = child.getName();      String childName = child.getName();
351        int    childNameLength = childName.length();
352      Logger best = rootLogger;      Logger best = rootLogger;
353      int    bestNameLength = 0;      int    bestNameLength = 0;
354    
# Line 366  public class LogManager Line 364  public class LogManager
364        candName = (String) iter.next();        candName = (String) iter.next();
365        candNameLength = candName.length();        candNameLength = candName.length();
366    
367        if ((candNameLength > bestNameLength)        if (candNameLength > bestNameLength
368              && childNameLength > candNameLength
369            && childName.startsWith(candName)            && childName.startsWith(candName)
370            && (childName.charAt(candNameLength) == '.'))            && childName.charAt(candNameLength) == '.')
371        {        {
372          cand = (Logger) ((WeakReference) loggers.get(candName)).get();          cand = (Logger) ((WeakReference) loggers.get(candName)).get();
373          if ((cand == null) || (cand == child))          if ((cand == null) || (cand == child))

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.9.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26