ceki        2003/03/18 13:17:43

  Modified:    src/java/org/apache/log4j BasicConfigurator.java
                        Hierarchy.java Layout.java FileAppender.java
                        DailyRollingFileAppender.java ConsoleAppender.java
                        AsyncAppender.java HTMLLayout.java
                        AppenderSkeleton.java DefaultCategoryFactory.java
                        CategoryKey.java
  Log:
  - Confirms to checkstyle tests.
  - Jalopy formatting.
  
  Revision  Changes    Path
  1.24      +53 -17    jakarta-log4j/src/java/org/apache/log4j/BasicConfigurator.java
  
  Index: BasicConfigurator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/BasicConfigurator.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- BasicConfigurator.java    7 May 2002 23:44:22 -0000       1.23
  +++ BasicConfigurator.java    18 Mar 2003 21:17:42 -0000      1.24
  @@ -1,14 +1,56 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
  +
   
   // Contibutors: "Luke Blanshard" <[EMAIL PROTECTED]>
   //              "Mark DONSZELMANN" <[EMAIL PROTECTED]>
   //              "Muly Oved" <[EMAIL PROTECTED]>
  -
   package org.apache.log4j;
   
   
  @@ -22,7 +64,6 @@
      @since 0.8.1
      @author Ceki G&uuml;lc&uuml; */
   public class BasicConfigurator {
  -
     protected BasicConfigurator() {
     }
   
  @@ -30,21 +71,18 @@
        Add a [EMAIL PROTECTED] ConsoleAppender} that uses [EMAIL PROTECTED] 
PatternLayout}
        using the [EMAIL PROTECTED] PatternLayout#TTCC_CONVERSION_PATTERN} and
        prints to <code>System.out</code> to the root category.  */
  -  static
  -  public
  -  void configure() {
  +  public static void configure() {
       Logger root = Logger.getRootLogger();
  -    root.addAppender(new ConsoleAppender(
  -           new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
  +    root.addAppender(
  +      new ConsoleAppender(
  +        new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
     }
   
     /**
        Add <code>appender</code> to the root category.
        @param appender The appender to add to the root category.
     */
  -  static
  -  public
  -  void configure(Appender appender) {
  +  public static void configure(Appender appender) {
       Logger root = Logger.getRootLogger();
       root.addAppender(appender);
     }
  @@ -55,9 +93,7 @@
        <code>Category.getDefaultHierarchy().resetConfiguration()</code>.
   
        See [EMAIL PROTECTED] Hierarchy#resetConfiguration()} for more details.  */
  -  public
  -  static
  -  void resetConfiguration() {
  +  public static void resetConfiguration() {
       LogManager.resetConfiguration();
     }
   }
  
  
  
  1.45      +204 -147  jakarta-log4j/src/java/org/apache/log4j/Hierarchy.java
  
  Index: Hierarchy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Hierarchy.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- Hierarchy.java    12 Dec 2002 05:20:22 -0000      1.44
  +++ Hierarchy.java    18 Mar 2003 21:17:42 -0000      1.45
  @@ -1,32 +1,73 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
  +
   
   // WARNING This class MUST not have references to the Category or
   // WARNING RootCategory classes in its static initiliazation neither
   // WARNING directly nor indirectly.
  -
   package org.apache.log4j;
   
  +import org.apache.log4j.Appender;
  +import org.apache.log4j.helpers.LogLog;
  +import org.apache.log4j.or.ObjectRenderer;
  +import org.apache.log4j.or.RendererMap;
  +import org.apache.log4j.spi.LoggerEventListener;
  +import org.apache.log4j.spi.LoggerFactory;
  +import org.apache.log4j.spi.LoggerRepository;
  +import org.apache.log4j.spi.LoggerRepositoryEventListener;
  +import org.apache.log4j.spi.RendererSupport;
   
  -import java.util.Hashtable;
  +import java.util.ArrayList;
   import java.util.Enumeration;
  +import java.util.Hashtable;
   import java.util.Vector;
  -import java.util.ArrayList;
   
  -import org.apache.log4j.spi.LoggerFactory;
  -import org.apache.log4j.spi.HierarchyEventListener;
  -import org.apache.log4j.spi.LoggerEventListener;
  -import org.apache.log4j.spi.LoggerRepositoryEventListener;
  -import org.apache.log4j.spi.LoggerRepository;
  -import org.apache.log4j.spi.RendererSupport;
  -import org.apache.log4j.Appender;
  -import org.apache.log4j.or.RendererMap;
  -import org.apache.log4j.or.ObjectRenderer;
  -import org.apache.log4j.helpers.LogLog;
   
   // Contributors: Luke Blanshard <[EMAIL PROTECTED]>
   //               Mario Schomburg - IBM Global Services/Germany
  @@ -56,18 +97,14 @@
   
   */
   public class Hierarchy implements LoggerRepository, RendererSupport {
  -
     private LoggerFactory defaultFactory;
     private ArrayList repositoryEventListeners;
     private ArrayList loggerEventListeners;
  -
     Hashtable ht;
     Logger root;
     RendererMap rendererMap;
  -
     int thresholdInt;
     Level threshold;
  -
     boolean emittedNoAppenderWarning = false;
     boolean emittedNoResourceBundleWarning = false;
   
  @@ -77,12 +114,12 @@
        @param root The root of the new hierarchy.
   
      */
  -  public
  -  Hierarchy(Logger root) {
  +  public Hierarchy(Logger root) {
       ht = new Hashtable();
       repositoryEventListeners = new ArrayList(1);
       loggerEventListeners = new ArrayList(1);
       this.root = root;
  +
       // Enable all level levels by default.
       setThreshold(Level.ALL);
       this.root.setHierarchy(this);
  @@ -98,14 +135,13 @@
     }
   
     /**
  -    Add a [EMAIL PROTECTED] LoggerRepositoryEventListener} to the repository. The 
  -    listener will be called when repository events occur. 
  +    Add a [EMAIL PROTECTED] LoggerRepositoryEventListener} to the repository. The
  +    listener will be called when repository events occur.
       @since 1.3*/
     public void addLoggerRepositoryEventListener(
       LoggerRepositoryEventListener listener) {
  -    
  -    synchronized(repositoryEventListeners) {
  -      if(repositoryEventListeners.contains(listener)) {
  +    synchronized (repositoryEventListeners) {
  +      if (repositoryEventListeners.contains(listener)) {
           LogLog.warn(
             "Ignoring attempt to add a previously registerd 
LoggerRepositoryEventListener.");
         } else {
  @@ -113,15 +149,14 @@
         }
       }
     }
  -    
  +
     /**
       Remove a [EMAIL PROTECTED] LoggerRepositoryEventListener} from the repository.
       @since 1.3*/
     public void removeLoggerRepositoryEventListener(
       LoggerRepositoryEventListener listener) {
  -    
  -    synchronized(repositoryEventListeners) {
  -      if(!repositoryEventListeners.contains(listener)) {
  +    synchronized (repositoryEventListeners) {
  +      if (!repositoryEventListeners.contains(listener)) {
           LogLog.warn(
             "Ignoring attempt to remove a non-registered 
LoggerRepositoryEventListener.");
         } else {
  @@ -131,12 +166,12 @@
     }
   
     /**
  -    Add a [EMAIL PROTECTED] LoggerEventListener} to the repository. The  listener 
  +    Add a [EMAIL PROTECTED] LoggerEventListener} to the repository. The  listener
       will be called when repository events occur.
       @since 1.3*/
     public void addLoggerEventListener(LoggerEventListener listener) {
  -    synchronized(loggerEventListeners) {
  -      if(loggerEventListeners.contains(listener)) {
  +    synchronized (loggerEventListeners) {
  +      if (loggerEventListeners.contains(listener)) {
           LogLog.warn(
             "Ignoring attempt to add a previously registerd LoggerEventListener.");
         } else {
  @@ -144,13 +179,13 @@
         }
       }
     }
  -    
  +
     /**
       Remove a [EMAIL PROTECTED] LoggerEventListener} from the repository.
       @since 1.3*/
     public void removeLoggerEventListener(LoggerEventListener listener) {
  -    synchronized(loggerEventListeners) {
  -      if(!loggerEventListeners.contains(listener)) {
  +    synchronized (loggerEventListeners) {
  +      if (!loggerEventListeners.contains(listener)) {
           LogLog.warn(
             "Ignoring attempt to remove a non-registered LoggerEventListener.");
         } else {
  @@ -175,9 +210,9 @@
   
     public void emitNoAppenderWarning(Category cat) {
       // No appenders in hierarchy, warn user only once.
  -    if(!this.emittedNoAppenderWarning) {
  -      LogLog.warn("No appenders could be found for logger (" +
  -                cat.getName() + ").");
  +    if (!this.emittedNoAppenderWarning) {
  +      LogLog.warn(
  +        "No appenders could be found for logger (" + cat.getName() + ").");
         LogLog.warn("Please initialize the log4j system properly.");
         this.emittedNoAppenderWarning = true;
       }
  @@ -191,7 +226,8 @@
     */
     public Logger exists(String name) {
       Object o = ht.get(new CategoryKey(name));
  -    if(o instanceof Logger) {
  +
  +    if (o instanceof Logger) {
         return (Logger) o;
       } else {
         return null;
  @@ -203,14 +239,14 @@
     */
     public void setThreshold(String levelStr) {
       Level l = Level.toLevel(levelStr, null);
  -    if(l != null) {
  +
  +    if (l != null) {
         setThreshold(l);
       } else {
  -      LogLog.warn("Could not convert ["+levelStr+"] to Level.");
  +      LogLog.warn("Could not convert [" + levelStr + "] to Level.");
       }
     }
   
  -
     /**
        Enable logging for logging requests with level <code>l</code> or
        higher. By default all levels are enabled.
  @@ -218,7 +254,7 @@
        @param l The minimum level for which logging requests are sent to
        their appenders.  */
     public void setThreshold(Level l) {
  -    if(l != null) {
  +    if (l != null) {
         thresholdInt = l.level;
         threshold = l;
       }
  @@ -227,53 +263,59 @@
     /**
       Requests that a appender added event be sent to any registered
       [EMAIL PROTECTED] LoggerEventListener}.
  -    @param logger The logger to which the appender was added. 
  +    @param logger The logger to which the appender was added.
       @param appender The appender added to the logger.
       @since 1.3*/
     public void fireAddAppenderEvent(Logger logger, Appender appender) {
       ArrayList list = copyListenerList(loggerEventListeners);
       int size = list.size();
  -    for(int i = 0; i < size; i++) {
  -      ((LoggerEventListener)list.get(i)).appenderAddedEvent(logger, appender);
  +
  +    for (int i = 0; i < size; i++) {
  +      ((LoggerEventListener) list.get(i)).appenderAddedEvent(logger, appender);
       }
     }
   
     /**
       Requests that a appender removed event be sent to any registered
       [EMAIL PROTECTED] LoggerEventListener}.
  -    @param logger The logger from which the appender was removed. 
  +    @param logger The logger from which the appender was removed.
       @param appender The appender removed from the logger.
       @since 1.3*/
     public void fireRemoveAppenderEvent(Logger logger, Appender appender) {
       ArrayList list = copyListenerList(loggerEventListeners);
       int size = list.size();
  -    for(int i = 0; i < size; i++) {
  -      ((LoggerEventListener)list.get(i)).appenderRemovedEvent(logger, appender);
  +
  +    for (int i = 0; i < size; i++) {
  +      ((LoggerEventListener) list.get(i)).appenderRemovedEvent(
  +        logger, appender);
       }
     }
   
     /**
       Requests that a level changed event be sent to any registered
  -    [EMAIL PROTECTED] LoggerEventListener}. 
  +    [EMAIL PROTECTED] LoggerEventListener}.
       @param logger The logger which changed levels.
       @since 1.3*/
     public void fireLevelChangedEvent(Logger logger) {
       ArrayList list = copyListenerList(loggerEventListeners);
       int size = list.size();
  -    for(int i = 0; i < size; i++) {
  -      ((LoggerEventListener)list.get(i)).levelChangedEvent(logger);
  +
  +    for (int i = 0; i < size; i++) {
  +      ((LoggerEventListener) list.get(i)).levelChangedEvent(logger);
       }
     }
   
     /**
       Requests that a configuration changed event be sent to any registered
  -    [EMAIL PROTECTED] LoggerRepositoryEventListener}. 
  +    [EMAIL PROTECTED] LoggerRepositoryEventListener}.
       @since 1.3*/
     public void fireConfigurationChangedEvent() {
       ArrayList list = copyListenerList(repositoryEventListeners);
       int size = list.size();
  -    for(int i = 0; i < size; i++) {
  -      ((LoggerRepositoryEventListener)list.get(i)).configurationChangedEvent(this);
  +
  +    for (int i = 0; i < size; i++) {
  +      ((LoggerRepositoryEventListener) list.get(i)).configurationChangedEvent(
  +        this);
       }
     }
   
  @@ -281,15 +323,19 @@
       Returns a copy of the given listener vector. */
     private ArrayList copyListenerList(ArrayList list) {
       ArrayList listCopy = null;
  -    synchronized(list) {
  +
  +    synchronized (list) {
         int size = list.size();
         listCopy = new ArrayList(size);
  +
         for (int x = 0; x < size; x++) {
           listCopy.add(list.get(x));
         }
       }
  +
       return listCopy;
     }
  +
     /**
        Returns a [EMAIL PROTECTED] Level} representation of the <code>enable</code>
        state.
  @@ -304,12 +350,12 @@
        threshold.
   
        @since 1.2 */
  +
     //public
     //int getThresholdInt() {
     //  return thresholdInt;
     //}
   
  -
     /**
        Return a new logger instance named as the first parameter using
        the default factory.
  @@ -320,54 +366,57 @@
   
        @param name The name of the logger to retrieve.
   
  - */
  +  */
     public Logger getLogger(String name) {
       return getLogger(name, defaultFactory);
     }
   
  - /**
  -     Return a new logger instance named as the first parameter using
  -     <code>factory</code>.
  +  /**
  +      Return a new logger instance named as the first parameter using
  +      <code>factory</code>.
   
  -     <p>If a logger of that name already exists, then it will be
  -     returned.  Otherwise, a new logger will be instantiated by the
  -     <code>factory</code> parameter and linked with its existing
  -     ancestors as well as children.
  +      <p>If a logger of that name already exists, then it will be
  +      returned.  Otherwise, a new logger will be instantiated by the
  +      <code>factory</code> parameter and linked with its existing
  +      ancestors as well as children.
   
  -     @param name The name of the logger to retrieve.
  -     @param factory The factory that will make the new logger instance.
  +      @param name The name of the logger to retrieve.
  +      @param factory The factory that will make the new logger instance.
   
  - */
  +  */
     public Logger getLogger(String name, LoggerFactory factory) {
       //System.out.println("getInstance("+name+") called.");
       CategoryKey key = new CategoryKey(name);
  +
       // Synchronize to prevent write conflicts. Read conflicts (in
       // getChainedLevel method) are possible only if variable
       // assignments are non-atomic.
       Logger logger;
   
  -    synchronized(ht) {
  +    synchronized (ht) {
         Object o = ht.get(key);
  -      if(o == null) {
  -     logger = factory.makeNewLoggerInstance(name);
  -     logger.setHierarchy(this);
  -     ht.put(key, logger);
  -     updateParents(logger);
  -     return logger;
  -      } else if(o instanceof Logger) {
  -     return (Logger) o;
  +
  +      if (o == null) {
  +        logger = factory.makeNewLoggerInstance(name);
  +        logger.setHierarchy(this);
  +        ht.put(key, logger);
  +        updateParents(logger);
  +
  +        return logger;
  +      } else if (o instanceof Logger) {
  +        return (Logger) o;
         } else if (o instanceof ProvisionNode) {
  -     //System.out.println("("+name+") ht.get(this) returned ProvisionNode");
  -     logger = factory.makeNewLoggerInstance(name);
  -     logger.setHierarchy(this);
  -     ht.put(key, logger);
  -     updateChildren((ProvisionNode) o, logger);
  -     updateParents(logger);
  -     return logger;
  -      }
  -      else {
  -     // It should be impossible to arrive here
  -     return null;  // but let's keep the compiler happy.
  +        //System.out.println("("+name+") ht.get(this) returned ProvisionNode");
  +        logger = factory.makeNewLoggerInstance(name);
  +        logger.setHierarchy(this);
  +        ht.put(key, logger);
  +        updateChildren((ProvisionNode) o, logger);
  +        updateParents(logger);
  +
  +        return logger;
  +      } else {
  +        // It should be impossible to arrive here
  +        return null; // but let's keep the compiler happy.
         }
       }
     }
  @@ -385,12 +434,15 @@
       Vector v = new Vector(ht.size());
   
       Enumeration elems = ht.elements();
  -    while(elems.hasMoreElements()) {
  +
  +    while (elems.hasMoreElements()) {
         Object o = elems.nextElement();
  -      if(o instanceof Logger) {
  -     v.addElement(o);
  +
  +      if (o instanceof Logger) {
  +        v.addElement(o);
         }
       }
  +
       return v.elements();
     }
   
  @@ -401,7 +453,6 @@
       return getCurrentLoggers();
     }
   
  -
     /**
        Get the renderer map for this hierarchy.
     */
  @@ -409,7 +460,6 @@
       return rendererMap;
     }
   
  -
     /**
        Get the root of this hierarchy.
   
  @@ -443,31 +493,34 @@
   
        @since 0.8.5 */
     public void resetConfiguration() {
  -    
       getRootLogger().setLevel(Level.DEBUG);
       root.setResourceBundle(null);
       setThreshold(Level.ALL);
   
       // the synchronization is needed to prevent JDK 1.2.x hashtable
       // surprises
  -    synchronized(ht) {
  +    synchronized (ht) {
         shutdown(true); // nested locks are OK
   
         Enumeration cats = getCurrentLoggers();
  -      while(cats.hasMoreElements()) {
  -             Logger c = (Logger) cats.nextElement();
  -             c.setLevel(null);
  -             c.setAdditivity(true);
  -             c.setResourceBundle(null);
  +
  +      while (cats.hasMoreElements()) {
  +        Logger c = (Logger) cats.nextElement();
  +        c.setLevel(null);
  +        c.setAdditivity(true);
  +        c.setResourceBundle(null);
         }
       }
  +
       rendererMap.clear();
   
       // inform the listeners that the configuration has been reset
       ArrayList list = copyListenerList(repositoryEventListeners);
       int size = list.size();
  -    for(int i = 0; i < size; i++) {
  -      ((LoggerRepositoryEventListener)list.get(i)).configurationResetEvent(this);
  +
  +    for (int i = 0; i < size; i++) {
  +      ((LoggerRepositoryEventListener) list.get(i)).configurationResetEvent(
  +        this);
       }
     }
   
  @@ -493,8 +546,7 @@
        and again to a nested appender.
   
        @since 1.0 */
  -  public
  -  void shutdown() {
  +  public void shutdown() {
       shutdown(false);
     }
   
  @@ -504,29 +556,32 @@
       if (!doingReset) {
         ArrayList list = copyListenerList(repositoryEventListeners);
         int size = list.size();
  -      for(int i = 0; i < size; i++) {
  -        ((LoggerRepositoryEventListener)list.get(i)).shutdownEvent(this);
  +
  +      for (int i = 0; i < size; i++) {
  +        ((LoggerRepositoryEventListener) list.get(i)).shutdownEvent(this);
         }
       }
  -    
  +
       Logger root = getRootLogger();
   
       // begin by closing nested appenders
       root.closeNestedAppenders();
   
  -    synchronized(ht) {
  +    synchronized (ht) {
         Enumeration cats = this.getCurrentLoggers();
  -      while(cats.hasMoreElements()) {
  -             Logger c = (Logger) cats.nextElement();
  -             c.closeNestedAppenders();
  +
  +      while (cats.hasMoreElements()) {
  +        Logger c = (Logger) cats.nextElement();
  +        c.closeNestedAppenders();
         }
   
         // then, remove all appenders
         root.removeAllAppenders();
         cats = this.getCurrentLoggers();
  -      while(cats.hasMoreElements()) {
  -             Logger c = (Logger) cats.nextElement();
  -             c.removeAllAppenders();
  +
  +      while (cats.hasMoreElements()) {
  +        Logger c = (Logger) cats.nextElement();
  +        c.removeAllAppenders();
         }
       }
     }
  @@ -551,42 +606,47 @@
   
           We add 'cat' to the list of children for this potential parent.
      */
  -  final private void updateParents(Logger cat) {
  +  private final void updateParents(Logger cat) {
       String name = cat.name;
       int length = name.length();
       boolean parentFound = false;
   
       //System.out.println("UpdateParents called for " + name);
  -
       // if name = "w.x.y.z", loop thourgh "w.x.y", "w.x" and "w", but not "w.x.y.z"
  -    for(int i = name.lastIndexOf('.', length-1); i >= 0;
  -                                      i = name.lastIndexOf('.', i-1))  {
  +    for (
  +      int i = name.lastIndexOf('.', length - 1); i >= 0;
  +        i = name.lastIndexOf('.', i - 1)) {
         String substr = name.substring(0, i);
   
         //System.out.println("Updating parent : " + substr);
         CategoryKey key = new CategoryKey(substr); // simple constructor
         Object o = ht.get(key);
  +
         // Create a provision node for a future parent.
  -      if(o == null) {
  -     //System.out.println("No parent "+substr+" found. Creating ProvisionNode.");
  -     ProvisionNode pn = new ProvisionNode(cat);
  -     ht.put(key, pn);
  -      } else if(o instanceof Category) {
  -     parentFound = true;
  -     cat.parent = (Category) o;
  -     //System.out.println("Linking " + cat.name + " -> " + ((Category) o).name);
  -     break; // no need to update the ancestors of the closest ancestor
  -      } else if(o instanceof ProvisionNode) {
  -     ((ProvisionNode) o).addElement(cat);
  +      if (o == null) {
  +        //System.out.println("No parent "+substr+" found. Creating ProvisionNode.");
  +        ProvisionNode pn = new ProvisionNode(cat);
  +        ht.put(key, pn);
  +      } else if (o instanceof Category) {
  +        parentFound = true;
  +        cat.parent = (Category) o;
  +
  +        //System.out.println("Linking " + cat.name + " -> " + ((Category) o).name);
  +        break; // no need to update the ancestors of the closest ancestor
  +      } else if (o instanceof ProvisionNode) {
  +        ((ProvisionNode) o).addElement(cat);
         } else {
  -     Exception e = new IllegalStateException("unexpected object type " +
  -                                     o.getClass() + " in ht.");
  -     e.printStackTrace();
  +        Exception e =
  +          new IllegalStateException(
  +            "unexpected object type " + o.getClass() + " in ht.");
  +        e.printStackTrace();
         }
       }
  +
       // If we could not find any existing parents, then link with root.
  -    if(!parentFound)
  +    if (!parentFound) {
         cat.parent = root;
  +    }
     }
   
     /**
  @@ -600,27 +660,24 @@
            If the child 'c' has been already linked to a child of
            'cat' then there is no need to update 'c'.
   
  -      Otherwise, we set cat's parent field to c's parent and set
  -      c's parent field to cat.
  +         Otherwise, we set cat's parent field to c's parent and set
  +         c's parent field to cat.
   
     */
  -  final private void updateChildren(ProvisionNode pn, Logger logger) {
  +  private final void updateChildren(ProvisionNode pn, Logger logger) {
       //System.out.println("updateChildren called for " + logger.name);
       final int last = pn.size();
   
  -    for(int i = 0; i < last; i++) {
  +    for (int i = 0; i < last; i++) {
         Logger l = (Logger) pn.elementAt(i);
  -      //System.out.println("Updating child " +p.name);
   
  +      //System.out.println("Updating child " +p.name);
         // Unless this child already points to a correct (lower) parent,
         // make cat.parent point to l.parent and l.parent to cat.
  -      if(!l.parent.name.startsWith(logger.name)) {
  -     logger.parent = l.parent;
  -     l.parent = logger;
  +      if (!l.parent.name.startsWith(logger.name)) {
  +        logger.parent = l.parent;
  +        l.parent = logger;
         }
       }
     }
  -
   }
  -
  -
  
  
  
  1.6       +57 -27    jakarta-log4j/src/java/org/apache/log4j/Layout.java
  
  Index: Layout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Layout.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Layout.java       13 Jul 2001 07:53:03 -0000      1.5
  +++ Layout.java       18 Mar 2003 21:17:42 -0000      1.6
  @@ -1,64 +1,97 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
  -import org.apache.log4j.spi.OptionHandler;
   import org.apache.log4j.spi.LoggingEvent;
  +import org.apache.log4j.spi.OptionHandler;
  +
   
   /**
      Extend this abstract class to create your own log layout format.
  -   
  +
      @author Ceki G&uuml;lc&uuml;
   
   */
  -  
   public abstract class Layout implements OptionHandler {
  -
     // Note that the line.separator property can be looked up even by
     // applets.
  -  public final static String LINE_SEP = System.getProperty("line.separator");
  -  public final static int LINE_SEP_LEN  = LINE_SEP.length();
  -
  +  public static final String LINE_SEP = System.getProperty("line.separator");
  +  public static final int LINE_SEP_LEN = LINE_SEP.length();
   
     /**
        Implement this method to create your own layout format.
     */
  -  abstract
  -  public
  -  String format(LoggingEvent event);
  +  public abstract String format(LoggingEvent event);
   
     /**
        Returns the content type output by this layout. The base class
  -     returns "text/plain". 
  +     returns "text/plain".
     */
  -  public
  -  String getContentType() {
  +  public String getContentType() {
       return "text/plain";
     }
   
     /**
        Returns the header for the layout format. The base class returns
        <code>null</code>.  */
  -  public
  -  String getHeader() {
  +  public String getHeader() {
       return null;
     }
   
     /**
        Returns the footer for the layout format. The base class returns
        <code>null</code>.  */
  -  public
  -  String getFooter() {
  +  public String getFooter() {
       return null;
     }
   
  -
  -
     /**
        If the layout handles the throwable object contained within
        [EMAIL PROTECTED] LoggingEvent}, then the layout should return
  @@ -70,8 +103,5 @@
        org.apache.log4j.xml.XMLLayout} returns <code>false</code>.
   
        @since 0.8.4 */
  -  abstract
  -  public
  -  boolean ignoresThrowable();
  -
  +  public abstract boolean ignoresThrowable();
   }
  
  
  
  1.36      +100 -79   jakarta-log4j/src/java/org/apache/log4j/FileAppender.java
  
  Index: FileAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/FileAppender.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- FileAppender.java 9 Oct 2002 22:50:02 -0000       1.35
  +++ FileAppender.java 18 Mar 2003 21:17:42 -0000      1.36
  @@ -1,20 +1,63 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
  +import org.apache.log4j.helpers.LogLog;
  +import org.apache.log4j.helpers.QuietWriter;
  +import org.apache.log4j.spi.ErrorCode;
  +
  +import java.io.BufferedWriter;
  +import java.io.FileOutputStream;
   import java.io.IOException;
   import java.io.Writer;
  -import java.io.FileOutputStream;
  -import java.io.BufferedWriter;
   
  -import org.apache.log4j.spi.ErrorCode;
  -import org.apache.log4j.helpers.QuietWriter;
  -import org.apache.log4j.helpers.LogLog;
   
   // Contibutors: Jens Uwe Pipka <[EMAIL PROTECTED]>
   //              Ben Sandee
  @@ -26,10 +69,9 @@
    *  has been deprecated and then removed. See the replacement
    *  solutions: [EMAIL PROTECTED] WriterAppender} and [EMAIL PROTECTED] 
ConsoleAppender}.
    *
  - * @author Ceki G&uuml;lc&uuml; 
  + * @author Ceki G&uuml;lc&uuml;
    * */
   public class FileAppender extends WriterAppender {
  -
     /** Append to or truncate the file? The default value for this
         variable is <code>true</code>, meaning that by default a
         <code>FileAppender</code> will append to an existing file and
  @@ -50,14 +92,12 @@
   
     /**
        How big should the IO buffer be? Default is 8K. */
  -  protected int bufferSize = 8*1024;
  -
  +  protected int bufferSize = 8 * 1024;
   
     /**
        The default constructor does not do anything.
     */
  -  public
  -  FileAppender() {
  +  public FileAppender() {
     }
   
     /**
  @@ -73,9 +113,9 @@
       then buffered IO will be used to write to the output file.
   
     */
  -  public
  -  FileAppender(Layout layout, String filename, boolean append, boolean bufferedIO,
  -            int bufferSize) throws IOException {
  +  public FileAppender(
  +    Layout layout, String filename, boolean append, boolean bufferedIO,
  +    int bufferSize) throws IOException {
       this.layout = layout;
       this.setFile(filename, append, bufferedIO, bufferSize);
     }
  @@ -89,9 +129,8 @@
       appended to. Otherwise, the file designated by
       <code>filename</code> will be truncated before being opened.
     */
  -  public
  -  FileAppender(Layout layout, String filename, boolean append)
  -                                                             throws IOException {
  +  public FileAppender(Layout layout, String filename, boolean append)
  +    throws IOException {
       this.layout = layout;
       this.setFile(filename, append, false, bufferSize);
     }
  @@ -102,8 +141,7 @@
       destination for this appender.
   
       <p>The file will be appended to.  */
  -  public
  -  FileAppender(Layout layout, String filename) throws IOException {
  +  public FileAppender(Layout layout, String filename) throws IOException {
       this(layout, filename, true);
     }
   
  @@ -126,15 +164,12 @@
     /**
         Returns the value of the <b>Append</b> option.
      */
  -  public
  -  boolean getAppend() {
  +  public boolean getAppend() {
       return fileAppend;
     }
   
  -
     /** Returns the value of the <b>File</b> option. */
  -  public
  -  String getFile() {
  +  public String getFile() {
       return fileName;
     }
   
  @@ -144,36 +179,33 @@
        <b>Append</b> properties.
   
        @since 0.8.1 */
  -  public
  -  void activateOptions() {
  -    if(fileName != null) {
  +  public void activateOptions() {
  +    if (fileName != null) {
         try {
  -     setFile(fileName, fileAppend, bufferedIO, bufferSize);
  -      }
  -      catch(java.io.IOException e) {
  -     errorHandler.error("setFile("+fileName+","+fileAppend+") call failed.",
  -                        e, ErrorCode.FILE_OPEN_FAILURE);
  +        setFile(fileName, fileAppend, bufferedIO, bufferSize);
  +      } catch (java.io.IOException e) {
  +        errorHandler.error(
  +          "setFile(" + fileName + "," + fileAppend + ") call failed.", e,
  +          ErrorCode.FILE_OPEN_FAILURE);
         }
       } else {
         //LogLog.error("File option not set for appender ["+name+"].");
  -      LogLog.warn("File option not set for appender ["+name+"].");
  +      LogLog.warn("File option not set for appender [" + name + "].");
         LogLog.warn("Are you using FileAppender instead of ConsoleAppender?");
       }
     }
   
  - /**
  -     Closes the previously opened file.
  -  */
  -  protected
  -  void closeFile() {
  -    if(this.qw != null) {
  +  /**
  +      Closes the previously opened file.
  +   */
  +  protected void closeFile() {
  +    if (this.qw != null) {
         try {
  -     this.qw.close();
  -      }
  -      catch(java.io.IOException e) {
  -     // Exceptionally, it does not make sense to delegate to an
  -     // ErrorHandler. Since a closed appender is basically dead.
  -     LogLog.error("Could not close " + qw, e);
  +        this.qw.close();
  +      } catch (java.io.IOException e) {
  +        // Exceptionally, it does not make sense to delegate to an
  +        // ErrorHandler. Since a closed appender is basically dead.
  +        LogLog.error("Could not close " + qw, e);
         }
       }
     }
  @@ -185,22 +217,17 @@
        loaded systems.
   
     */
  -  public
  -  boolean getBufferedIO() {
  +  public boolean getBufferedIO() {
       return this.bufferedIO;
     }
   
  -
     /**
        Get the size of the IO buffer.
     */
  -  public
  -  int getBufferSize() {
  +  public int getBufferSize() {
       return this.bufferSize;
     }
   
  -
  -
     /**
        The <b>Append</b> option takes a boolean value. It is set to
        <code>true</code> by default. If true, then <code>File</code>
  @@ -211,8 +238,7 @@
        <p>Note: Actual opening of the file is made when [EMAIL PROTECTED]
        #activateOptions} is called, not when the options are set.
      */
  -  public
  -  void setAppend(boolean flag) {
  +  public void setAppend(boolean flag) {
       fileAppend = flag;
     }
   
  @@ -226,20 +252,18 @@
        loaded systems.
   
     */
  -  public
  -  void setBufferedIO(boolean bufferedIO) {
  +  public void setBufferedIO(boolean bufferedIO) {
       this.bufferedIO = bufferedIO;
  -    if(bufferedIO) {
  +
  +    if (bufferedIO) {
         immediateFlush = false;
       }
     }
   
  -
     /**
        Set the size of the IO buffer.
     */
  -  public
  -  void setBufferSize(int bufferSize) {
  +  public void setBufferSize(int bufferSize) {
       this.bufferSize = bufferSize;
     }
   
  @@ -257,22 +281,24 @@
       @param fileName The path to the log file.
       @param append   If true will append to fileName. Otherwise will
           truncate fileName.  */
  -  public
  -  synchronized
  -  void setFile(String fileName, boolean append, boolean bufferedIO, int bufferSize)
  -                                                            throws IOException {
  -    LogLog.debug("setFile called: "+fileName+", "+append);
  +  public synchronized void setFile(
  +    String fileName, boolean append, boolean bufferedIO, int bufferSize)
  +    throws IOException {
  +    LogLog.debug("setFile called: " + fileName + ", " + append);
   
       // It does not make sense to have immediate flush and bufferedIO.
  -    if(bufferedIO) {
  +    if (bufferedIO) {
         setImmediateFlush(false);
       }
   
       reset();
  +
       Writer fw = createWriter(new FileOutputStream(fileName, append));
  -    if(bufferedIO) {
  +
  +    if (bufferedIO) {
         fw = new BufferedWriter(fw, bufferSize);
       }
  +
       this.setQWForFiles(fw);
       this.fileName = fileName;
       this.fileAppend = append;
  @@ -282,26 +308,21 @@
       LogLog.debug("setFile ended");
     }
   
  -
     /**
        Sets the quiet writer being used.
   
        This method is overriden by [EMAIL PROTECTED] RollingFileAppender}.
      */
  -  protected
  -  void setQWForFiles(Writer writer) {
  -     this.qw = new QuietWriter(writer, errorHandler);
  +  protected void setQWForFiles(Writer writer) {
  +    this.qw = new QuietWriter(writer, errorHandler);
     }
   
  -
     /**
        Close any previously opened file and call the parent's
        <code>reset</code>.  */
  -  protected
  -  void reset() {
  +  protected void reset() {
       closeFile();
       this.fileName = null;
       super.reset();
     }
   }
  -
  
  
  
  1.23      +198 -123  
jakarta-log4j/src/java/org/apache/log4j/DailyRollingFileAppender.java
  
  Index: DailyRollingFileAppender.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/DailyRollingFileAppender.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DailyRollingFileAppender.java     18 Feb 2003 00:30:38 -0000      1.22
  +++ DailyRollingFileAppender.java     18 Mar 2003 21:17:42 -0000      1.23
  @@ -1,25 +1,68 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  -
  -
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
  -import java.io.IOException;
  +import org.apache.log4j.helpers.LogLog;
  +import org.apache.log4j.spi.LoggingEvent;
  +
   import java.io.File;
  +import java.io.IOException;
  +
   import java.text.SimpleDateFormat;
  +
  +import java.util.Calendar;
   import java.util.Date;
   import java.util.GregorianCalendar;
  -import java.util.Calendar;
  -import java.util.TimeZone;
   import java.util.Locale;
  +import java.util.TimeZone;
   
  -import org.apache.log4j.helpers.LogLog;
  -import org.apache.log4j.spi.LoggingEvent;
   
   /**
      DailyRollingFileAppender extends [EMAIL PROTECTED] FileAppender} so that the
  @@ -123,18 +166,18 @@
      @author Eirik Lygre
      @author Ceki G&uuml;lc&uuml; */
   public class DailyRollingFileAppender extends FileAppender {
  -
  -
     // The code assumes that the following constants are in a increasing
     // sequence.
  -  static final int TOP_OF_TROUBLE=-1;
  +  static final int TOP_OF_TROUBLE = -1;
     static final int TOP_OF_MINUTE = 0;
  -  static final int TOP_OF_HOUR   = 1;
  -  static final int HALF_DAY      = 2;
  -  static final int TOP_OF_DAY    = 3;
  -  static final int TOP_OF_WEEK   = 4;
  -  static final int TOP_OF_MONTH  = 5;
  +  static final int TOP_OF_HOUR = 1;
  +  static final int HALF_DAY = 2;
  +  static final int TOP_OF_DAY = 3;
  +  static final int TOP_OF_WEEK = 4;
  +  static final int TOP_OF_MONTH = 5;
   
  +  // The gmtTimeZone is used only in computeCheckPeriod() method.
  +  static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT");
   
     /**
        The date pattern. By default, the pattern is set to
  @@ -147,29 +190,21 @@
        scheduledFilename variable when the next interval is entered. For
        example, if the rollover period is one hour, the log file will be
        renamed to the value of "scheduledFilename" at the beginning of
  -     the next hour. 
  +     the next hour.
   
        The precise time when a rollover occurs depends on logging
  -     activity. 
  +     activity.
     */
     private String scheduledFilename;
   
     /**
        The next time we estimate a rollover should occur. */
  -  private long nextCheck = System.currentTimeMillis () - 1;
  -
  +  private long nextCheck = System.currentTimeMillis() - 1;
     Date now = new Date();
  -
     SimpleDateFormat sdf;
  -
     RollingCalendar rc = new RollingCalendar();
  -
     int checkPeriod = TOP_OF_TROUBLE;
   
  -  // The gmtTimeZone is used only in computeCheckPeriod() method.
  -  static final TimeZone gmtTimeZone = TimeZone.getTimeZone("GMT");
  -
  -
     /**
        The default constructor does nothing. */
     public DailyRollingFileAppender() {
  @@ -181,8 +216,9 @@
       become the ouput destination for this appender.
   
       */
  -  public DailyRollingFileAppender (Layout layout, String filename,
  -                                String datePattern) throws IOException {
  +  public DailyRollingFileAppender(
  +    Layout layout, String filename, String datePattern)
  +    throws IOException {
       super(layout, filename, true);
       this.datePattern = datePattern;
       activateOptions();
  @@ -204,52 +240,64 @@
   
     public void activateOptions() {
       super.activateOptions();
  -    if(datePattern != null && fileName != null) {
  +
  +    if ((datePattern != null) && (fileName != null)) {
         now.setTime(System.currentTimeMillis());
         sdf = new SimpleDateFormat(datePattern);
  +
         int type = computeCheckPeriod();
         printPeriodicity(type);
         rc.setType(type);
  -      File file = new File(fileName);
  -      scheduledFilename = fileName+sdf.format(new Date(file.lastModified()));
   
  +      File file = new File(fileName);
  +      scheduledFilename = fileName + sdf.format(new Date(file.lastModified()));
       } else {
  -      LogLog.error("Either File or DatePattern options are not set for appender ["
  -                +name+"].");
  +      LogLog.error(
  +        "Either File or DatePattern options are not set for appender [" + name
  +        + "].");
       }
     }
   
     void printPeriodicity(int type) {
  -    switch(type) {
  +    switch (type) {
       case TOP_OF_MINUTE:
  -      LogLog.debug("Appender ["+name+"] to be rolled every minute.");
  +      LogLog.debug("Appender [" + name + "] to be rolled every minute.");
  +
         break;
  +
       case TOP_OF_HOUR:
  -      LogLog.debug("Appender ["+name
  -                +"] to be rolled on top of every hour.");
  +      LogLog.debug(
  +        "Appender [" + name + "] to be rolled on top of every hour.");
  +
         break;
  +
       case HALF_DAY:
  -      LogLog.debug("Appender ["+name
  -                +"] to be rolled at midday and midnight.");
  +      LogLog.debug(
  +        "Appender [" + name + "] to be rolled at midday and midnight.");
  +
         break;
  +
       case TOP_OF_DAY:
  -      LogLog.debug("Appender ["+name
  -                +"] to be rolled at midnight.");
  +      LogLog.debug("Appender [" + name + "] to be rolled at midnight.");
  +
         break;
  +
       case TOP_OF_WEEK:
  -      LogLog.debug("Appender ["+name
  -                +"] to be rolled at start of week.");
  +      LogLog.debug("Appender [" + name + "] to be rolled at start of week.");
  +
         break;
  +
       case TOP_OF_MONTH:
  -      LogLog.debug("Appender ["+name
  -                +"] to be rolled at start of every month.");
  +      LogLog.debug(
  +        "Appender [" + name + "] to be rolled at start of every month.");
  +
         break;
  +
       default:
  -      LogLog.warn("Unknown periodicity for appender ["+name+"].");
  +      LogLog.warn("Unknown periodicity for appender [" + name + "].");
       }
     }
   
  -
     // This method computes the roll over period by looping over the
     // periods, starting with the shortest, and stopping when the r0 is
     // different from from r1, where r0 is the epoch formatted according
  @@ -258,25 +306,31 @@
     // formatting is done in GMT and not local format because the test
     // logic is based on comparisons relative to 1970-01-01 00:00:00
     // GMT (the epoch).
  -
     int computeCheckPeriod() {
  -    RollingCalendar rollingCalendar = new RollingCalendar(gmtTimeZone, 
Locale.ENGLISH);
  +    RollingCalendar rollingCalendar =
  +      new RollingCalendar(GMT_TIMEZONE, Locale.ENGLISH);
  +
       // set sate to 1970-01-01 00:00:00 GMT
       Date epoch = new Date(0);
  -    if(datePattern != null) {
  -      for(int i = TOP_OF_MINUTE; i <= TOP_OF_MONTH; i++) {
  -     SimpleDateFormat simpleDateFormat = new SimpleDateFormat(datePattern);
  -     simpleDateFormat.setTimeZone(gmtTimeZone); // do all date formatting in GMT
  -     String r0 = simpleDateFormat.format(epoch);
  -     rollingCalendar.setType(i);
  -     Date next = new Date(rollingCalendar.getNextCheckMillis(epoch));
  -     String r1 =  simpleDateFormat.format(next);
  -     //System.out.println("Type = "+i+", r0 = "+r0+", r1 = "+r1);
  -     if(r0 != null && r1 != null && !r0.equals(r1)) {
  -       return i;
  -     }
  +
  +    if (datePattern != null) {
  +      for (int i = TOP_OF_MINUTE; i <= TOP_OF_MONTH; i++) {
  +        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(datePattern);
  +        simpleDateFormat.setTimeZone(GMT_TIMEZONE); // do all date formatting in GMT
  +
  +        String r0 = simpleDateFormat.format(epoch);
  +        rollingCalendar.setType(i);
  +
  +        Date next = new Date(rollingCalendar.getNextCheckMillis(epoch));
  +        String r1 = simpleDateFormat.format(next);
  +
  +        //System.out.println("Type = "+i+", r0 = "+r0+", r1 = "+r1);
  +        if ((r0 != null) && (r1 != null) && !r0.equals(r1)) {
  +          return i;
  +        }
         }
       }
  +
       return TOP_OF_TROUBLE; // Deliberately head for trouble...
     }
   
  @@ -284,14 +338,15 @@
        Rollover the current file to a new file.
     */
     void rollOver() throws IOException {
  -
       /* Compute filename, but only if datePattern is specified */
       if (datePattern == null) {
         errorHandler.error("Missing DatePattern option in rollOver().");
  +
         return;
       }
   
  -    String datedFilename = fileName+sdf.format(now);
  +    String datedFilename = fileName + sdf.format(now);
  +
       // It is too early to roll over because we are still within the
       // bounds of the current interval. Rollover will occur once the
       // next interval is reached.
  @@ -302,27 +357,30 @@
       // close current file, and rename it to datedFilename
       this.closeFile();
   
  -    File target  = new File(scheduledFilename);
  +    File target = new File(scheduledFilename);
  +
       if (target.exists()) {
         target.delete();
       }
   
       File file = new File(fileName);
       boolean result = file.renameTo(target);
  -    if(result) {
  -      LogLog.debug(fileName +" -> "+ scheduledFilename);
  +
  +    if (result) {
  +      LogLog.debug(fileName + " -> " + scheduledFilename);
       } else {
  -      LogLog.error("Failed to rename ["+fileName+"] to ["+scheduledFilename+"].");
  +      LogLog.error(
  +        "Failed to rename [" + fileName + "] to [" + scheduledFilename + "].");
       }
   
       try {
         // This will also close the file. This is OK since multiple
         // close operations are safe.
         this.setFile(fileName, false, this.bufferedIO, this.bufferSize);
  +    } catch (IOException e) {
  +      errorHandler.error("setFile(" + fileName + ", false) call failed.");
       }
  -    catch(IOException e) {
  -      errorHandler.error("setFile("+fileName+", false) call failed.");
  -    }
  +
       scheduledFilename = datedFilename;
     }
   
  @@ -336,36 +394,38 @@
      * */
     protected void subAppend(LoggingEvent event) {
       long n = System.currentTimeMillis();
  +
       if (n >= nextCheck) {
         now.setTime(n);
         nextCheck = rc.getNextCheckMillis(now);
  +
         try {
  -     rollOver();
  -      }
  -      catch(IOException ioe) {
  -     LogLog.error("rollOver() failed.", ioe);
  +        rollOver();
  +      } catch (IOException ioe) {
  +        LogLog.error("rollOver() failed.", ioe);
         }
       }
  +
       super.subAppend(event);
  -   }
  +  }
   }
   
  +
   /**
    *  RollingCalendar is a helper class to DailyRollingFileAppender.
    *  Given a periodicity type and the current time, it computes the
  - *  start of the next interval.  
  + *  start of the next interval.
    * */
   class RollingCalendar extends GregorianCalendar {
  -
     int type = DailyRollingFileAppender.TOP_OF_TROUBLE;
   
     RollingCalendar() {
       super();
  -  }  
  +  }
   
     RollingCalendar(TimeZone tz, Locale locale) {
       super(tz, locale);
  -  }  
  +  }
   
     void setType(int type) {
       this.type = type;
  @@ -378,54 +438,69 @@
     public Date getNextCheckDate(Date now) {
       this.setTime(now);
   
  -    switch(type) {
  +    switch (type) {
       case DailyRollingFileAppender.TOP_OF_MINUTE:
  -     this.set(Calendar.SECOND, 0);
  -     this.set(Calendar.MILLISECOND, 0);
  -     this.add(Calendar.MINUTE, 1);
  -     break;
  +      this.set(Calendar.SECOND, 0);
  +      this.set(Calendar.MILLISECOND, 0);
  +      this.add(Calendar.MINUTE, 1);
  +
  +      break;
  +
       case DailyRollingFileAppender.TOP_OF_HOUR:
  -     this.set(Calendar.MINUTE, 0);
  -     this.set(Calendar.SECOND, 0);
  -     this.set(Calendar.MILLISECOND, 0);
  -     this.add(Calendar.HOUR_OF_DAY, 1);
  -     break;
  +      this.set(Calendar.MINUTE, 0);
  +      this.set(Calendar.SECOND, 0);
  +      this.set(Calendar.MILLISECOND, 0);
  +      this.add(Calendar.HOUR_OF_DAY, 1);
  +
  +      break;
  +
       case DailyRollingFileAppender.HALF_DAY:
  -     this.set(Calendar.MINUTE, 0);
  -     this.set(Calendar.SECOND, 0);
  -     this.set(Calendar.MILLISECOND, 0);
  -     int hour = get(Calendar.HOUR_OF_DAY);
  -     if(hour < 12) {
  -       this.set(Calendar.HOUR_OF_DAY, 12);
  -     } else {
  -       this.set(Calendar.HOUR_OF_DAY, 0);
  -       this.add(Calendar.DAY_OF_MONTH, 1);
  -     }
  -     break;
  +      this.set(Calendar.MINUTE, 0);
  +      this.set(Calendar.SECOND, 0);
  +      this.set(Calendar.MILLISECOND, 0);
  +
  +      int hour = get(Calendar.HOUR_OF_DAY);
  +
  +      if (hour < 12) {
  +        this.set(Calendar.HOUR_OF_DAY, 12);
  +      } else {
  +        this.set(Calendar.HOUR_OF_DAY, 0);
  +        this.add(Calendar.DAY_OF_MONTH, 1);
  +      }
  +
  +      break;
  +
       case DailyRollingFileAppender.TOP_OF_DAY:
  -     this.set(Calendar.HOUR_OF_DAY, 0);
  -     this.set(Calendar.MINUTE, 0);
  -     this.set(Calendar.SECOND, 0);
  -     this.set(Calendar.MILLISECOND, 0);
  -     this.add(Calendar.DATE, 1);
  -     break;
  +      this.set(Calendar.HOUR_OF_DAY, 0);
  +      this.set(Calendar.MINUTE, 0);
  +      this.set(Calendar.SECOND, 0);
  +      this.set(Calendar.MILLISECOND, 0);
  +      this.add(Calendar.DATE, 1);
  +
  +      break;
  +
       case DailyRollingFileAppender.TOP_OF_WEEK:
  -     this.set(Calendar.DAY_OF_WEEK, getFirstDayOfWeek());
  -     this.set(Calendar.HOUR_OF_DAY, 0);
  -     this.set(Calendar.SECOND, 0);
  -     this.set(Calendar.MILLISECOND, 0);
  -     this.add(Calendar.WEEK_OF_YEAR, 1);
  -     break;
  +      this.set(Calendar.DAY_OF_WEEK, getFirstDayOfWeek());
  +      this.set(Calendar.HOUR_OF_DAY, 0);
  +      this.set(Calendar.SECOND, 0);
  +      this.set(Calendar.MILLISECOND, 0);
  +      this.add(Calendar.WEEK_OF_YEAR, 1);
  +
  +      break;
  +
       case DailyRollingFileAppender.TOP_OF_MONTH:
  -     this.set(Calendar.DATE, 1);
  -     this.set(Calendar.HOUR_OF_DAY, 0);
  -     this.set(Calendar.SECOND, 0);
  -     this.set(Calendar.MILLISECOND, 0);
  -     this.add(Calendar.MONTH, 1);
  -     break;
  +      this.set(Calendar.DATE, 1);
  +      this.set(Calendar.HOUR_OF_DAY, 0);
  +      this.set(Calendar.SECOND, 0);
  +      this.set(Calendar.MILLISECOND, 0);
  +      this.add(Calendar.MONTH, 1);
  +
  +      break;
  +
       default:
  -     throw new IllegalStateException("Unknown periodicity type.");
  +      throw new IllegalStateException("Unknown periodicity type.");
       }
  +
       return getTime();
     }
   }
  
  
  
  1.14      +57 -20    jakarta-log4j/src/java/org/apache/log4j/ConsoleAppender.java
  
  Index: ConsoleAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/ConsoleAppender.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ConsoleAppender.java      9 Oct 2002 22:50:01 -0000       1.13
  +++ ConsoleAppender.java      18 Mar 2003 21:17:42 -0000      1.14
  @@ -1,27 +1,69 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
  -import java.io.OutputStreamWriter;
   import org.apache.log4j.helpers.LogLog;
   
  +import java.io.OutputStreamWriter;
  +
  +
   /**
     * ConsoleAppender appends log events to <code>System.out</code> or
     * <code>System.err</code> using a layout specified by the user. The
     * default target is <code>System.out</code>.
     *
  -  * @author Ceki G&uuml;lc&uuml; 
  +  * @author Ceki G&uuml;lc&uuml;
     * @since 1.1 */
   public class ConsoleAppender extends WriterAppender {
  -
     public static final String SYSTEM_OUT = "System.out";
     public static final String SYSTEM_ERR = "System.err";
  -
     protected String target = SYSTEM_OUT;
   
     /**
  @@ -49,10 +91,9 @@
     /**
      *  Sets the value of the <b>Target</b> option. Recognized values
      *  are "System.out" and "System.err". Any other value will be
  -   *  ignored.  
  +   *  ignored.
      * */
  -  public
  -  void setTarget(String value) {
  +  public void setTarget(String value) {
       String v = value.trim();
   
       if (SYSTEM_OUT.equalsIgnoreCase(v)) {
  @@ -70,19 +111,17 @@
      *
      * See also [EMAIL PROTECTED] #setTarget}.
      * */
  -  public
  -  String getTarget() {
  +  public String getTarget() {
       return target;
     }
   
     void targetWarn(String val) {
  -    LogLog.warn("["+val+"] should be System.out or System.err.");
  +    LogLog.warn("[" + val + "] should be System.out or System.err.");
       LogLog.warn("Using previously set target, System.out by default.");
     }
   
  -  public
  -  void activateOptions() {
  -    if(target.equals(SYSTEM_OUT)) {
  +  public void activateOptions() {
  +    if (target.equals(SYSTEM_OUT)) {
         setWriter(new OutputStreamWriter(System.out));
       } else {
         setWriter(new OutputStreamWriter(System.err));
  @@ -94,8 +133,6 @@
      *  WriterAppender#closeWriter} implementation to do nothing because
      *  the console stream is not ours to close.
      * */
  -  protected
  -  final
  -  void closeWriter() {
  +  protected final void closeWriter() {
     }
   }
  
  
  
  1.33      +7 -7      jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java
  
  Index: AsyncAppender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- AsyncAppender.java        18 Mar 2003 19:46:30 -0000      1.32
  +++ AsyncAppender.java        18 Mar 2003 21:17:42 -0000      1.33
  @@ -98,11 +98,11 @@
     public static final int DEFAULT_BUFFER_SIZE = 128;
   
     //static Category cat = Category.getInstance(AsyncAppender.class.getName());
  -  BoundedFIFO bf = new BoundedFIFO(DEFAULT_BUFFER_SIZE);
  +  private BoundedFIFO bf = new BoundedFIFO(DEFAULT_BUFFER_SIZE);
     AppenderAttachableImpl aai;
  -  Dispatcher dispatcher;
  -  boolean locationInfo = false;
  -  boolean interruptedWarningMessage = false;
  +  private Dispatcher dispatcher;
  +  private boolean locationInfo = false;
  +  private boolean interruptedWarningMessage = false;
   
     public AsyncAppender() {
       // Note: The dispatcher code assumes that the aai is set once and
  @@ -284,9 +284,9 @@
   // ------------------------------------------------------------------------------
   // ----------------------------------------------------------------------------
   class Dispatcher extends Thread {
  -  BoundedFIFO bf;
  -  AppenderAttachableImpl aai;
  -  boolean interrupted = false;
  +  private BoundedFIFO bf;
  +  private AppenderAttachableImpl aai;
  +  private boolean interrupted = false;
     AsyncAppender container;
   
     Dispatcher(BoundedFIFO bf, AsyncAppender container) {
  
  
  
  1.29      +115 -62   jakarta-log4j/src/java/org/apache/log4j/HTMLLayout.java
  
  Index: HTMLLayout.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/HTMLLayout.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- HTMLLayout.java   9 Oct 2002 22:50:02 -0000       1.28
  +++ HTMLLayout.java   18 Mar 2003 21:17:42 -0000      1.29
  @@ -1,15 +1,58 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
  -import org.apache.log4j.spi.LoggingEvent;
  -import org.apache.log4j.spi.LocationInfo;
   import org.apache.log4j.helpers.Transform;
  +import org.apache.log4j.spi.LocationInfo;
  +import org.apache.log4j.spi.LoggingEvent;
  +
   
   /**
      This layout outputs events in a HTML table.
  @@ -17,14 +60,7 @@
      @author Ceki G&uuml;lc&uuml;
    */
   public class HTMLLayout extends Layout {
  -
  -  protected final int BUF_SIZE = 256;
  -  protected final int MAX_CAPACITY = 1024;
  -
  -  static String TRACE_PREFIX = "<br>&nbsp;&nbsp;&nbsp;&nbsp;";
  -
  -  // output buffer appended to when format() is invoked
  -  private StringBuffer sbuf = new StringBuffer(BUF_SIZE);
  +  static final String TRACE_PREFIX = "<br>&nbsp;&nbsp;&nbsp;&nbsp;";
   
     /**
        A string constant used in naming the option for setting the the
  @@ -46,10 +82,14 @@
        constant is <b>Title</b>.
     */
     public static final String TITLE_OPTION = "Title";
  +  protected static final int BUF_SIZE = 256;
  +  protected static final int MAX_CAPACITY = 1024;
  +
  +  // output buffer appended to when format() is invoked
  +  private StringBuffer sbuf = new StringBuffer(BUF_SIZE);
   
     // Print no location info by default
     boolean locationInfo = false;
  -
     String title = "Log4J Log Messages";
   
     /**
  @@ -63,16 +103,14 @@
        org.apache.log4j.net.SMTPAppender} then make sure to set the
        <b>LocationInfo</b> option of that appender as well.
      */
  -  public
  -  void setLocationInfo(boolean flag) {
  +  public void setLocationInfo(boolean flag) {
       locationInfo = flag;
     }
   
     /**
        Returns the current value of the <b>LocationInfo</b> option.
      */
  -  public
  -  boolean getLocationInfo() {
  +  public boolean getLocationInfo() {
       return locationInfo;
     }
   
  @@ -82,38 +120,32 @@
   
       <p>Defaults to 'Log4J Log Messages'.
     */
  -  public
  -  void setTitle(String title) {
  +  public void setTitle(String title) {
       this.title = title;
     }
   
     /**
        Returns the current value of the <b>Title</b> option.
     */
  -  public
  -  String getTitle() {
  +  public String getTitle() {
       return title;
     }
   
  - /**
  -     Returns the content type output by this layout, i.e "text/html".
  -  */
  -  public
  -  String getContentType() {
  +  /**
  +      Returns the content type output by this layout, i.e "text/html".
  +   */
  +  public String getContentType() {
       return "text/html";
     }
   
     /**
        No options to activate.
     */
  -  public
  -  void activateOptions() {
  +  public void activateOptions() {
     }
   
  -  public
  -  String format(LoggingEvent event) {
  -
  -    if(sbuf.capacity() > MAX_CAPACITY) {
  +  public String format(LoggingEvent event) {
  +    if (sbuf.capacity() > MAX_CAPACITY) {
         sbuf = new StringBuffer(BUF_SIZE);
       } else {
         sbuf.setLength(0);
  @@ -130,25 +162,26 @@
       sbuf.append("</td>" + Layout.LINE_SEP);
   
       sbuf.append("<td title=\"Level\">");
  +
       if (event.getLevel().equals(Level.DEBUG)) {
         sbuf.append("<font color=\"#339933\">");
         sbuf.append(event.getLevel());
         sbuf.append("</font>");
  -    }
  -    else if(event.getLevel().isGreaterOrEqual(Level.WARN)) {
  +    } else if (event.getLevel().isGreaterOrEqual(Level.WARN)) {
         sbuf.append("<font color=\"#993300\"><strong>");
         sbuf.append(event.getLevel());
         sbuf.append("</strong></font>");
       } else {
         sbuf.append(event.getLevel());
       }
  +
       sbuf.append("</td>" + Layout.LINE_SEP);
   
       sbuf.append("<td title=\"" + event.getLoggerName() + " category\">");
       sbuf.append(Transform.escapeTags(event.getLoggerName()));
       sbuf.append("</td>" + Layout.LINE_SEP);
   
  -    if(locationInfo) {
  +    if (locationInfo) {
         LocationInfo locInfo = event.getLocationInformation();
         sbuf.append("<td>");
         sbuf.append(Transform.escapeTags(locInfo.getFileName()));
  @@ -163,14 +196,17 @@
       sbuf.append("</tr>" + Layout.LINE_SEP);
   
       if (event.getNDC() != null) {
  -      sbuf.append("<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" 
colspan=\"6\" title=\"Nested Diagnostic Context\">");
  +      sbuf.append(
  +        "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" 
title=\"Nested Diagnostic Context\">");
         sbuf.append("NDC: " + Transform.escapeTags(event.getNDC()));
         sbuf.append("</td></tr>" + Layout.LINE_SEP);
       }
   
       String[] s = event.getThrowableStrRep();
  -    if(s != null) {
  -      sbuf.append("<tr><td bgcolor=\"#993300\" style=\"color:White; font-size : 
xx-small;\" colspan=\"6\">");
  +
  +    if (s != null) {
  +      sbuf.append(
  +        "<tr><td bgcolor=\"#993300\" style=\"color:White; font-size : xx-small;\" 
colspan=\"6\">");
         appendThrowableAsHTML(s, sbuf);
         sbuf.append("</td></tr>" + Layout.LINE_SEP);
       }
  @@ -179,16 +215,20 @@
     }
   
     void appendThrowableAsHTML(String[] s, StringBuffer sbuf) {
  -    if(s != null) {
  +    if (s != null) {
         int len = s.length;
  -      if(len == 0)
  -     return;
  +
  +      if (len == 0) {
  +        return;
  +      }
  +
         sbuf.append(Transform.escapeTags(s[0]));
         sbuf.append(Layout.LINE_SEP);
  -      for(int i = 1; i < len; i++) {
  -     sbuf.append(TRACE_PREFIX);
  -     sbuf.append(Transform.escapeTags(s[i]));
  -     sbuf.append(Layout.LINE_SEP);
  +
  +      for (int i = 1; i < len; i++) {
  +        sbuf.append(TRACE_PREFIX);
  +        sbuf.append(Transform.escapeTags(s[i]));
  +        sbuf.append(Layout.LINE_SEP);
         }
       }
     }
  @@ -196,55 +236,68 @@
     /**
        Returns appropriate HTML headers.
     */
  -  public
  -  String getHeader() {
  +  public String getHeader() {
       StringBuffer sbuf = new StringBuffer();
  -    sbuf.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" 
\"http://www.w3.org/TR/html4/loose.dtd\";>"  + Layout.LINE_SEP);
  +    sbuf.append(
  +      "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" 
\"http://www.w3.org/TR/html4/loose.dtd\";>"
  +      + Layout.LINE_SEP);
       sbuf.append("<html>" + Layout.LINE_SEP);
       sbuf.append("<head>" + Layout.LINE_SEP);
       sbuf.append("<title>" + title + "</title>" + Layout.LINE_SEP);
  -    sbuf.append("<style type=\"text/css\">"  + Layout.LINE_SEP);
  -    sbuf.append("<!--"  + Layout.LINE_SEP);
  -    sbuf.append("body, table {font-family: arial,sans-serif; font-size: x-small;}" 
+ Layout.LINE_SEP);
  -    sbuf.append("th {background: #336699; color: #FFFFFF; text-align: left;}" + 
Layout.LINE_SEP);
  +    sbuf.append("<style type=\"text/css\">" + Layout.LINE_SEP);
  +    sbuf.append("<!--" + Layout.LINE_SEP);
  +    sbuf.append(
  +      "body, table {font-family: arial,sans-serif; font-size: x-small;}"
  +      + Layout.LINE_SEP);
  +    sbuf.append(
  +      "th {background: #336699; color: #FFFFFF; text-align: left;}"
  +      + Layout.LINE_SEP);
       sbuf.append("-->" + Layout.LINE_SEP);
       sbuf.append("</style>" + Layout.LINE_SEP);
       sbuf.append("</head>" + Layout.LINE_SEP);
  -    sbuf.append("<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">" + 
Layout.LINE_SEP);
  +    sbuf.append(
  +      "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">"
  +      + Layout.LINE_SEP);
       sbuf.append("<hr size=\"1\" noshade>" + Layout.LINE_SEP);
  -    sbuf.append("Log session start time " + new java.util.Date() + "<br>" + 
Layout.LINE_SEP);
  +    sbuf.append(
  +      "Log session start time " + new java.util.Date() + "<br>"
  +      + Layout.LINE_SEP);
       sbuf.append("<br>" + Layout.LINE_SEP);
  -    sbuf.append("<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" 
bordercolor=\"#224466\" width=\"100%\">" + Layout.LINE_SEP);
  +    sbuf.append(
  +      "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" 
bordercolor=\"#224466\" width=\"100%\">"
  +      + Layout.LINE_SEP);
       sbuf.append("<tr>" + Layout.LINE_SEP);
       sbuf.append("<th>Time</th>" + Layout.LINE_SEP);
       sbuf.append("<th>Thread</th>" + Layout.LINE_SEP);
       sbuf.append("<th>Level</th>" + Layout.LINE_SEP);
       sbuf.append("<th>Category</th>" + Layout.LINE_SEP);
  -    if(locationInfo) {
  +
  +    if (locationInfo) {
         sbuf.append("<th>File:Line</th>" + Layout.LINE_SEP);
       }
  +
       sbuf.append("<th>Message</th>" + Layout.LINE_SEP);
       sbuf.append("</tr>" + Layout.LINE_SEP);
  +
       return sbuf.toString();
     }
   
     /**
        Returns the appropriate HTML footers.
     */
  -  public
  -  String getFooter() {
  +  public String getFooter() {
       StringBuffer sbuf = new StringBuffer();
       sbuf.append("</table>" + Layout.LINE_SEP);
       sbuf.append("<br>" + Layout.LINE_SEP);
       sbuf.append("</body></html>");
  +
       return sbuf.toString();
     }
   
     /**
        The HTML layout handles the throwable contained in logging
        events. Hence, this method return <code>false</code>.  */
  -  public
  -  boolean ignoresThrowable() {
  +  public boolean ignoresThrowable() {
       return false;
     }
   }
  
  
  
  1.23      +4 -2      jakarta-log4j/src/java/org/apache/log4j/AppenderSkeleton.java
  
  Index: AppenderSkeleton.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/AppenderSkeleton.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- AppenderSkeleton.java     18 Mar 2003 13:33:31 -0000      1.22
  +++ AppenderSkeleton.java     18 Mar 2003 21:17:42 -0000      1.23
  @@ -124,7 +124,8 @@
      */
     public void addFilter(Filter newFilter) {
       if (headFilter == null) {
  -      headFilter = tailFilter = newFilter;
  +      headFilter = newFilter;
  +      tailFilter = newFilter;
       } else {
         tailFilter.next = newFilter;
         tailFilter = newFilter;
  @@ -146,7 +147,8 @@
      * @since 0.9.0
      */
     public void clearFilters() {
  -    headFilter = tailFilter = null;
  +    headFilter = null;
  +    tailFilter = null;
     }
   
     /**
  
  
  
  1.9       +51 -10    
jakarta-log4j/src/java/org/apache/log4j/DefaultCategoryFactory.java
  
  Index: DefaultCategoryFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/DefaultCategoryFactory.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultCategoryFactory.java       4 Sep 2001 18:44:47 -0000       1.8
  +++ DefaultCategoryFactory.java       18 Mar 2003 21:17:42 -0000      1.9
  @@ -1,21 +1,62 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
   import org.apache.log4j.spi.LoggerFactory;
   
  +
   class DefaultCategoryFactory implements LoggerFactory {
  -    
     DefaultCategoryFactory() {
  -  }    
  -    
  -  public
  -  Logger makeNewLoggerInstance(String name) {
  +  }
  +
  +  public Logger makeNewLoggerInstance(String name) {
       return new Logger(name);
  -  }    
  +  }
   }
  
  
  
  1.4       +58 -18    jakarta-log4j/src/java/org/apache/log4j/CategoryKey.java
  
  Index: CategoryKey.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/CategoryKey.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CategoryKey.java  13 Jul 2001 07:52:50 -0000      1.3
  +++ CategoryKey.java  18 Mar 2003 21:17:42 -0000      1.4
  @@ -1,19 +1,61 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * ============================================================================
  + *                   The Apache Software License, Version 1.1
  + * ============================================================================
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of  source code must  retain the above copyright  notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include  the following  acknowledgment:  "This product includes  software
  + *    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  + *    Alternately, this  acknowledgment may  appear in the software itself,  if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
  + *    endorse  or promote  products derived  from this  software without  prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products  derived from this software may not  be called "Apache", nor may
  + *    "Apache" appear  in their name,  without prior written permission  of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + *
  + * This software  consists of voluntary contributions made  by many individuals
  + * on  behalf of the Apache Software  Foundation.  For more  information on the
  + * Apache Software Foundation, please see <http://www.apache.org/>.
  + *
  + */
   
   package org.apache.log4j;
   
  +
   /**
      CategoryKey is heavily used internally to accelerate hash table searches.
  -   @author Ceki G&uuml;lc&uuml; 
  +   @author Ceki G&uuml;lc&uuml;
   */
   class CategoryKey {
  -
  -  String   name;  
  +  String name;
     int hashCache;
   
     CategoryKey(String name) {
  @@ -21,21 +63,19 @@
       hashCache = name.hashCode();
     }
   
  -  final
  -  public  
  -  int hashCode() {
  +  public final int hashCode() {
       return hashCache;
     }
   
  -  final
  -  public
  -  boolean equals(Object rArg) {
  -    if(this == rArg)
  +  public final boolean equals(Object rArg) {
  +    if (this == rArg) {
         return true;
  -    
  -    if(rArg != null && CategoryKey.class == rArg.getClass()) 
  -      return  name == ((CategoryKey)rArg ).name;
  -    else 
  +    }
  +
  +    if ((rArg != null) && (CategoryKey.class == rArg.getClass())) {
  +      return name == ((CategoryKey) rArg).name;
  +    } else {
         return false;
  +    }
     }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to