You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by ce...@apache.org on 2001/01/11 23:59:42 UTC

cvs commit: jakarta-log4j/org/apache/log4j Category.java Hierarchy.java

ceki        01/01/11 14:59:42

  Modified:    org/apache/log4j Category.java Hierarchy.java
  Log:
  Corrected serious bug in Hierarchy.java reported by Wolfram Gewohn.
  
  Revision  Changes    Path
  1.11      +2 -2      jakarta-log4j/org/apache/log4j/Category.java
  
  Index: Category.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/Category.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Category.java	2001/01/11 19:48:35	1.10
  +++ Category.java	2001/01/11 22:59:41	1.11
  @@ -303,7 +303,7 @@
   
       <p><b>WARNING</b> Note that passing a {@link Throwable} to this
       method will print the name of the <code>Throwable</code> but no
  -    stack trace. To print a stack trace use the {@link #error(Object,
  +    stack trace. To print a stack trace use the {@link #debug(Object,
       Throwable)} form instead.
       
       @param message the message object to log. */
  @@ -938,7 +938,7 @@
   
     /**
        Only the Hiearchy class can set the hiearchy of a
  -     category. Default package access is mandatory here.  */
  +     category. Default package access is MANDATORY here.  */
     final
     void setHierarchy(Hierarchy hierarchy) {
       this.myContext = hierarchy;
  
  
  
  1.9       +4 -5      jakarta-log4j/org/apache/log4j/Hierarchy.java
  
  Index: Hierarchy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/Hierarchy.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Hierarchy.java	2001/01/07 21:10:56	1.8
  +++ Hierarchy.java	2001/01/11 22:59:41	1.9
  @@ -68,7 +68,7 @@
     Hierarchy(Category root) {
       ht = new Hashtable();
       this.root = root;
  -    this.root.myContext  = this;      
  +    this.root.setHierarchy(this);
       rendererMap = new RendererMap();
     }
   
  @@ -160,13 +160,12 @@
   	ht.put(key, category);      
   	updateParents(category);
   	return category;
  -      }
  -      else if(o instanceof Category) {
  +      } else if(o instanceof Category) {
   	return (Category) o;
  -      }
  -      else if (o instanceof ProvisionNode) {
  +      } else if (o instanceof ProvisionNode) {
   	//System.out.println("("+name+") ht.get(this) returned ProvisionNode");
   	category = factory.makeNewCategoryInstance(name);
  +	category.setHierarchy(this); 
   	ht.put(key, category);
   	updateChildren((ProvisionNode) o, category);
   	updateParents(category);