ceki        2005/01/06 14:20:14

  Modified:    src/java/org/apache/log4j/spi ComponentBase.java
  Log:
  Let successive setLR() calls with the same LR proceed without throwing an 
exception.
  
  Revision  Changes    Path
  1.3       +4 -2      
logging-log4j/src/java/org/apache/log4j/spi/ComponentBase.java
  
  Index: ComponentBase.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/src/java/org/apache/log4j/spi/ComponentBase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ComponentBase.java        4 Jan 2005 15:09:54 -0000       1.2
  +++ ComponentBase.java        6 Jan 2005 22:20:14 -0000       1.3
  @@ -28,7 +28,9 @@
     public void setLoggerRepository(LoggerRepository repository) {
       if(this.repository == null) {
         this.repository = repository;
  -    } else {
  +    } else if(this.repository == repository) {
  +      // Nothing to do. Someone is trying to set the repository once again.
  +    } else { 
         throw new IllegalStateException("Repository has been already set");
       }
     }
  @@ -38,7 +40,7 @@
      * This logger is not intended to be accessed by the end-user, hence the 
      * protected keyword.
      * 
  -   * <p>In case the repository for this components is not set,
  +   * <p>In case the repository for this component is not set,
      * this implementations returns a [EMAIL PROTECTED] SimpleLogger} instance.
      * 
      * @return A ULogger instance.
  
  
  

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

Reply via email to